2016-11-08 63 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") 希望这会有所帮助