--- trunk/libxmltv/Core/XMLTVLoader.cs 2013/03/08 04:01:25 46 +++ trunk/libxmltv/Core/XMLTVLoader.cs 2013/03/08 05:20:12 49 @@ -6,6 +6,7 @@ using System.IO; using Enterprise.Logging; using System.Xml.Linq; +using System.Xml; namespace libxmltv.Core { @@ -39,7 +40,17 @@ //xmltv_logger.Log.Warn.WriteLine("XML File Loading has not been implemented yet!"); try { - instance.XmlDoc = XDocument.Load(instance.XmlFile.FullName); + var document = XDocument.Load(instance.XmlFile.FullName); + using (var ms = new MemoryStream()) + using (var xw = new XmlTextWriter(ms, Encoding.UTF8)) + { + document.Save(xw); + xw.Flush(); + StreamReader sr = new StreamReader(ms); + ms.Seek(0, SeekOrigin.Begin); + instance.XmlDoc = sr.ReadToEnd(); + } + document = null; } catch (Exception ex) { @@ -52,5 +63,7 @@ { //throw new NotImplementedException(); } + + } }