XPathNodeIterator problem

philprice

Well-known member
Joined
Mar 21, 2003
Messages
116
Location
Hull, UK
Right im getting an RSS feed, but i have two problems:

a) It looks at child nodes of in item - how do i stop it
b) It doesnt work

Code:
Do While (XMLFeedInfo.MoveNext)
            Debug.WriteLine("Node: " + XMLFeedInfo.Current.Name + " -> " + XMLFeedInfo.Current.Value)
            If (CStr(XMLFeedInfo.Current.Name).ToUpper = "TITLE") Then
                feed.siteTitle = CStr(XMLFeedInfo.Current.Value)
            End If

            If (CStr(XMLFeedInfo.Current.Name).ToUpper = "LINK") Then
                feed.siteLink = CStr(XMLFeedInfo.Current.Value)
            End If

        Loop

The XMLFeedInfo object is created by...

Code:
 Set which node path to look down for feed info (e.g. /channel)
        Dim XMLFeedInfo = docNavigator.Select(strFeedInfoNodePath)

 Where strFeedInfoNodePath = /rss/channel

Example of the XML from http://diveintomark.org/xml/rss.xml

Code:
  <?xml version="1.0" encoding="utf-8" ?> 
<rss version="3.14159265359" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>dive into mark</title> 
  <link>[url]http://diveintomark.org/[/url]</link> 
  <description>A lot of effort went into making this effortless.</description> 
  <dc:language>en</dc:language> 
  <dc:creator>Mark Pilgrim (f8dy@diveintomark.org)</dc:creator> 
  <dc:rights>Copyright 2003 Mark Pilgrim</dc:rights> 
  <dc:date>2003-03-21T14:20:26-05:00</dc:date> 
  <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.62" /> 
  <admin:errorReportsTo rdf:resource="mailto:f8dy@diveintomark.org" /> 
  <sy:updatePeriod>daily</sy:updatePeriod> 
  <sy:updateFrequency>8</sy:updateFrequency> 
  <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> 
<item>

    ......

I want to get /rss/channel/title and /rss/channel/link but the above code just wont work and i cant figure out why, any ideas?
 
Back
Top