Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

RSS Driving Me Mad!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mr.D - 21 Oct 2004 13:08 GMT
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
lancer@nsoftware.removeme.com - 21 Oct 2004 14:24 GMT
>       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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.