我有一个这样的 XML 文件:
我想获取所有标签 a:entry
<?xml version="1.0" encoding="utf-8"?>
<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://schemas.zune.net/catalog/apps/2008/02">
<a:link rel="next" type="application/atom+xml" href="/v8/catalog/apps?q=facebook&startIndex=50&chunkSize=50&pagingToken=50%7c50&os=8.0.10512.0&cc=US&oc=&lang=vi-VN&hw=469838850&dm=Virtual&oemId=NOKIA&moId=" />
<a:link rel="self" type="application/atom+xml" href="/v8/catalog/apps?q=facebook&chunkSize=50&os=8.0.10512.0&cc=US&oc=&lang=vi-VN&hw=469838850&dm=Virtual&oemId=NOKIA&moId=" />
<os:startIndex>0</os:startIndex>
<os:totalResults>51</os:totalResults>
<os:itemsPerPage>50</os:itemsPerPage>
<a:updated>2013-11-01T08:30:11.711450Z</a:updated>
<a:title type="text">List Of Items</a:title>
<a:id>tag:catalog.zune.net,2013-11-01:/apps</a:id>
<pagingToken>50|50</pagingToken>
<impressionId>cd11c7b0116143dcb4c99f15b72ebbc4</impressionId>
<a:entry>
<a:updated>2013-11-01T08:30:11.711450Z</a:updated>
<a:title type="text">Facebook</a:title>
<a:id>urn:uuid:82a23635-5bd9-df11-a844-00237de2db9e</a:id>
<isHardwareCompatible>true</isHardwareCompatible>
<sortTitle>Facebook</sortTitle>
<releaseDate>2010-10-19T13:07:17.103000Z</releaseDate>
<version>5.1.2.0</version>
<averageUserRating>5.963479</averageUserRating>
<userRatingCount>42825</userRatingCount>
<image>
<id>urn:uuid:f8b42bcd-45c3-4ea5-9c9e-a108ac33cd6e</id>
</image>
<hasLiveTile>true</hasLiveTile>
<categories>
<category>
<id>windowsphone.Social</id>
<title>mạng xã hội</title>
<isRoot>True</isRoot>
</category>
</categories>
<tags>
<tag>Independent</tag>
<tag>LockScreen_Background</tag>
<tag>LockScreen_Notification_IconCount</tag>
<tag>LockScreen_Notification_TextField</tag>
<tag>phone.protocol.fb</tag>
</tags>
<offers>
<offer>
<offerId>urn:uuid:5c6b4028-74c5-4648-a71e-2ca413a5d2fd</offerId>
<mediaInstanceId>urn:uuid:64051c69-fb7b-4972-ad42-1dbb2e626a2c</mediaInstanceId>
<clientTypes>
<clientType>WindowsPhone80</clientType>
<clientType>WindowsPhone81</clientType>
</clientTypes>
<paymentTypes>
<paymentType>Credit Card</paymentType>
<paymentType>Mobile Operator</paymentType>
</paymentTypes>
<store>ZEST</store>
<price>0</price>
<displayPrice>$0.00</displayPrice>
<priceCurrencyCode>USD</priceCurrencyCode>
<licenseRight>Purchase</licenseRight>
</offer>
</offers>
<publisher>
<id>Microsoft Corporation</id>
<name>Microsoft Corporation</name>
</publisher>
<impressionId>cd11c7b0116143dcb4c99f15b72ebbc4</impressionId>
<k>4</k>
</a:entry>
我的代码:
var list = from r in xdoc.Descendants("a:entry") select r;
我得到了这个错误:
':' 字符,十六进制值 0x3A,不能包含在名称中。
我如何获得 a:entry 标签?谢谢 :)