【问题标题】:Parse attribute of Media Element媒体元素的解析属性
【发布时间】:2013-08-14 23:18:06
【问题描述】:

我想从 XML 中解析 url 属性,并从以下提要链接的列表框中显示图像控件(由 URL 引用的那个)中的图像:http://feeds.bbci.co.uk/news/rss.xml

我的代码是:

var ComingNewsFromUri = from rss in XElement.Parse(e.Result).Descendants("item")
                        select new  NewsItems
                        {
                            Title = rss.Element("title").Value,
                            PubDate = rss.Element("pubDate").Value,
                            Description = rss.Element("description").Value
                        };

【问题讨论】:

    标签: c#-4.0 xml-parsing linq-to-xml windows-phone


    【解决方案1】:

    对于 RSS,我建议使用 SyndicationFeed 和 SyndicationItem....自动为您出色地完成所有解析和转换为对象。

    http://ryanhayes.net/blog/how-to-build-an-rss-feed-reader-in-windows-phone-7part-i-retrieving-parsing-and-displaying-post-titles/

    我自己在商店里有一个使用 SyndicationFeed 的 RSS 提要应用程序,它非常可靠和方便。

    这是 Microsoft 的另一个示例

    http://code.msdn.microsoft.com/wpapps/RSS-Reader-Sample-1702775f

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-23
      • 1970-01-01
      • 1970-01-01
      • 2015-02-06
      • 2012-03-13
      • 1970-01-01
      • 2010-09-07
      相关资源
      最近更新 更多