Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

 

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...

 

'' 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

 

 <?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?

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...