I wrote a code snippet that uses the System.ServiceModel.Syndication
library to parse RSS feeds.
The problem is that for one of my channels (which is provided by facebook) I get the following line at the end of the answer, and the Syndication library does not parse the feed, because it says the text is invalid XML, and it says that this is because of this part :
... </channel> <access:restriction relationship="deny" xmlns:access="http://www.bloglines.com/about/specs/fac-1.0" /> </rss>
Iโm sure that something is missing here, because both the feed and the parsing library are from huge companies (Facebook and Microsoft, respectively).
Can any of you help? Or, alternatively, a better parser that does not rely on XML validity?
PS Here is my RSS feed URL:
http://www.facebook.com/feeds/page.php?id=202296766494181&format=rss20
This is how I parse the response to the feed:
var stringReader = new StringReader(resp); var xreader = XmlReader.Create(stringReader); var xfeed = System.ServiceModel.Syndication.SyndicationFeed.Load(xreader);
and the exception that I get:
System.Xml.XmlException: 'Element' is an invalid XmlNodeType. Line 282, position 4.
in System.Xml.XmlReader.ReadEndElement () ...
source share