XPath表达式,用于根据节点属性c#选择self,Parents和后续节点

时间:2016-03-26 20:44:28

标签: c# xpath

需要xPath为给定的页面选择所有[aqua]节点[@ ID ='NeededPage']

Please take a look at the attached image

1 个答案:

答案 0 :(得分:1)

您可以尝试:

 //Page[@ID='NeededPage']/descendant-or-self::* | //Page[@ID='NeededPage']/ancestor::*

查看http://www.w3schools.com/xsl/xpath_axes.asp