RSS Driving Me Mad!

  • Thread starter Thread starter Mr.D
  • Start date Start date
M

Mr.D

I'm trying to read a RSS feed.
It works somewhat OK on some feed, while it craches on others :-/

What am I doing wrong(besides from all)?
Am I looking for the wrong thing?

<code>
Dim dsPubs As New Data.DataSet
Dim xdcDOC As New Xml.XmlDocument
Dim i As Integer = -1
Dim tblItem As Integer = -1
Dim colTitle As Integer = -1
Dim colLink As Integer = -1

dsPubs.ReadXml(TreeView1.SelectedNode.Text)

For i = 0 To dsPubs.Tables.Count - 1
If dsPubs.Tables(i).TableName = "channel" Then tblItem = i
Next
If tblItem = -1 Then Exit Sub '// Not found!?

For i = 0 To dsPubs.Tables(tblItem).Columns.Count - 1
If dsPubs.Tables(1).Columns(i).Caption = "title" Then
colTitle = i
ElseIf dsPubs.Tables(1).Columns(i).Caption = "link" Then
colLink = i
End If
Next
MsgBox(colTitle & vbNewLine & colLink)
</code>
 
For i = 0 To dsPubs.Tables.Count - 1
dsPubs.Tables(i).TableName = "channel" Then tblItem = i

For RSS
2.0 /rss/channel/ is the xpath for the channel element - but make sure that the
feed you are reading is rss and not atom, which doesn't have a channel element
(its called title there).

Regards,
Lance R.
/n
software
http://www.nsoftware.com/

-
 
For RSS
2.0 /rss/channel/ is the xpath for the channel element - but make sure that the
feed you are reading is rss and not atom, which doesn't have a channel element
(its called title there).

Well that explains whay it only worked with some sites.
I got it now.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top