I have a problem for parsing a rss feed using c#.
I used to use this method to load the feed.
XDocument rssFeed = XDocument.Load(@url);
But, when I notice when the feed has a xml-stylesheet this method crashes saying the xml is not well formated…
Here’s a rss feed that contains this tag
http://www.channelnews.fr/accueil.feed?type=rss
What would be the best way to parse any rss feed using c#?
Thanks for your help
This code works for me
Note, that if you omit setting UserAgent, then response will contain string ‘DOS’ that is defnintly not xml 🙂