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>
----
Tim
> For i = 0 To dsPubs.Tables.Count - 1
> If dsPubs.Tables(i).TableName = "channel" Then tblItem = i
> Next
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/
-
Mr.D - 21 Oct 2004 22:31 GMT
> 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
----
Tim