2016-11-08 53 views
0

我現在的XML節點是:獲取價值currentnode

<Item xsi:type="itm:Resource"> 
<ID>10</ID> 
</Item> 

我想讀取整個標籤和搜索資源是否有或沒有在標籤:

SelectSingleNode.OuterXml.Contains("Resource") 

但外xml正在考慮項目內的所有標籤,我只想爲當前節點

已嘗試過其他屬性,如name,value,其中只返回「Item」

回答

0

我用一種稍微不同的方式做了它 SelectSingleNode("xPath").Attributes(0).Value.Contains("Resource") 希望這會有所幫助