public static RankLog CreateRankLogFromXml(string ranklogXML) { System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; System.Threading.Thread.CurrentThread.CurrentCulture = customCulture; var document = new XmlDocument(); var settings = new XmlReaderSettings { CloseInput = true, XmlResolver = null, DtdProcessing = DtdProcessing.Prohibit }; using (XmlReader reader = XmlReader.Create(new StringReader(ranklogXML), settings)) { document.Load(reader); } var rankLog = new RankLog(); rankLog.Parse(document.DocumentElement); return(rankLog); }
static void Main(string[] args) { string ranklogXML = File.ReadAllText(args[0]); var ranklog = RankLog.CreateRankLogFromXml(ranklogXML); foreach (var element in ranklog.Elements) { Console.WriteLine(element); } Console.ReadKey(); }