private List <Epg2> debug_epg2(string data) { try { List <Epg2> list_en = new List <Epg2>(); XmlDocument doc = new XmlDocument(); doc.LoadXml(data); foreach (XmlElement xitem in doc.DocumentElement.SelectNodes("//item")) { Epg2 en = new Epg2(); XmlDocument idoc = new XmlDocument(); idoc.LoadXml("<root>" + xitem.InnerXml + "</root>"); foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//chid")) { en.id = link.InnerText; } foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//progname")) { en.progname = link.InnerText; } foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//end")) { en.end = link.InnerText; } foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//start")) { en.start = link.InnerText; } list_en.Add(en); } return(list_en); } catch (Exception) { throw new System.InvalidOperationException("Error to load epg2"); } }
private List<Epg2> debug_epg2(string data) { try { List<Epg2> list_en = new List<Epg2>(); XmlDocument doc = new XmlDocument(); doc.LoadXml(data); foreach (XmlElement xitem in doc.DocumentElement.SelectNodes("//item")) { Epg2 en = new Epg2(); XmlDocument idoc = new XmlDocument(); idoc.LoadXml("<root>"+xitem.InnerXml+"</root>"); foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//chid")) { en.id = link.InnerText; } foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//progname")) { en.progname = link.InnerText; } foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//end")) { en.end = link.InnerText; } foreach (XmlElement link in idoc.DocumentElement.SelectNodes("//start")) { en.start = link.InnerText; } list_en.Add(en); } return list_en; } catch (Exception) { throw new System.InvalidOperationException("Error to load epg2"); } }