예제 #1
0
 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");
     }
 }
예제 #2
0
파일: SovokAPI.cs 프로젝트: legator/SovokTV
        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");
            }
        }