【发布时间】:2011-03-23 23:34:29
【问题描述】:
我正在努力解析 Google 供稿。我对普通的 RSS 没有任何问题,但是这个稍微复杂的基于 ATOM 的提要对我来说不适用于相同的简单解析代码。 我怎样才能到达入口元素?
我使用的以下代码不起作用,它不返回任何集合,但可以与 RSS 一起使用以获取
XElement _xml = XElement.Parse(response);
foreach (XElement value in _xml.Elements("entry"))
{
...
}
当条目元素具有 gd:etag="..." 时,我如何才能访问它们?
任何帮助表示赞赏。
--------------- 饲料样本 ----------
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:docs="http://schemas.google.com/docs/2007" xmlns:batch="http://schemas.google.com/gdata/batch"
xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"DUMFR3YyfCt7ImA9WxNTFU0."">
<id>https://docs.google.com/feeds/default/private/full</id>
<updated>2009-08-17T11:10:16.894Z</updated>
<title>Available Documents - user@gmail.com</title>
<openSearch:startIndex>1</openSearch:startIndex>
<entry gd:etag="'EVJVTBICRit7ImBq'">
<id>https://docs.google.com/feeds/id/document%3A12345</id>
<published>2009-07-22T19:02:57.616Z</published>
<updated>2009-07-29T20:31:39.804Z</updated>
</entry>
<entry gd:etag="'HhJSFgpeRyt7ImBq'">
<id>https://docs.google.com/feeds/id/pdf%3A12345</id>
<published>2009-04-09T18:23:09.035Z</published>
<updated>2009-04-09T18:23:09.035Z</updated>
</entry>
...
</feed>
【问题讨论】:
标签: windows-phone-7