2005-10-27, 08:09 PM
I'm trying to parse my xmltv file to pull out the programme start/end times, channel id and title. I'm using an XPath query to get all the programmes as follows (apologies for it being VB.NET but it's much the same when done in C#)...
The problem is that each '<programme>' node actually has the timing and channel info in it as in...
But each XmlNode in ProgrammeList simply has an XmlNode.Name of 'programme'. for the life of me I can't find a way to get the rest of the data.
Is this possible or do I need to treat the XML file simply as flat text and just do string searches on each line read? I can do that already but it's horribly inefficient.
Cheers,
Brian
PS unless I'm missing something, I can't find anything in the GBPVR.Public namespace which allows me to access the original file - only the EPG data in the database.
Code:
Dim GuideDoc As Xml.XmlDocument
Dim GuideNode, TempNode1, TempNode2 As Xml.XmlNode
Dim ProgrammeList, TitleList As Xml.XmlNodeList
GuideDoc = New Xml.XmlDocument
GuideDoc.Load(New Xml.XmlTextReader(New IO.StreamReader("C:\Program Files\XMLTV Radio Times\data.xml")))
GuideNode = GuideDoc.DocumentElement
ProgrammeList = GuideNode.SelectNodes("programme")
Code:
<programme start="200510260915 +0100" stop="200510261000 +0100" channel="26">
Is this possible or do I need to treat the XML file simply as flat text and just do string searches on each line read? I can do that already but it's horribly inefficient.
Cheers,
Brian
PS unless I'm missing something, I can't find anything in the GBPVR.Public namespace which allows me to access the original file - only the EPG data in the database.