This post originated from an RSS feed registered with .NET Buzz
by Doug Thews.
Original Post: Problems Using ReadXml to Consume RSS
Feed Title: IlluminatiLand
Feed URL: http://apps5.oingo.com/apps/domainpark/domainpark.cgi?client=netw8744&s=JETBRAINS.COM
Feed Description: A technology blog for people enlightened enough to think for themselves
I'm in the process of making an ActiveDesktop with a navigation frame to contain hyperlinks to the latest "favorite" RSS feed entries. I started by using the ReadXml method to load in the RSS feed from an XmlTextReader.
I compared my code with the only other 2 examples I could find: 4GuysFromRolla and tiberi.us. Their approaches on reading the data in differ. 4GuysFromRolla used the same XmlTextReader tact that I'd chosen, while tiberi.us used the HttpRequest/Http/Response method.
However, as I read through their examples I did find a significant problem as well as a problem with using the ReadXml tact. If you take a look at each of their code listings, both show the same snippet of code to get to the list of elements after loading them into the data set:
ds = new dataset
ds.LoadXml(url)
ItemTable = ds.Tables(2)
By using the ordinal value of 2, you're forcing the format of the element coming as the 3rd place element node in the document. Well, the MS feeds might work that way, but Schobleizer and a lot of other feeds don't (they have other elements like and others. So, my recommendation is to use the column name (albeit slower than accessing tables with an ordinal value):