开发者

MVC2 - Consume RSS feed with RDF and namespace http://www.w3.org/1999/02/22-rdf-syntax-ns#'

开发者 https://www.devze.com 2023-02-27 04:38 出处:网络
I\' trying to read the feed for the Washington Departmene of Fish and Wildlife, and keep etting this error:

I' trying to read the feed for the Washington Departmene of Fish and Wildlife, and keep etting this error:

The element with name 'RDF' and namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' is not an allowed feed format.

Here's the code from RssController:

public virtual ActionResult Index()
{
    string feedUrl = @"http://wdfw.wa.gov/news/newsrss.php";

    using (XmlReader reader = XmlReader.Create(feedUrl))
    {

        **SyndicationFeed rss = SyndicationFeed.Load(reader);**

        return View(rss);
    }            
}

I've done seveal RSS applications but nave never ran into this issue.开发者_如何学运维 Anyone got any concrete ways of being able to parse this in ASP.NET MVC 2? (the lines with asterics are where the exception happens.


There's no support for RSS 1.0. Example of how to roll your own support here : https://web.archive.org/web/20211020140320/https://www.4guysfromrolla.com/articles/031809-1.aspx


This may not be applicable to you as it sounds like you are only interested in RSS, but if you want RDF support for your application (RSS 1.0 uses RDF/XML to encode it's data) then you could try my library dotNetRDF.

I suspect that a full blown RDF API is probably overkill though judging from your question.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号