给出以下xml文档
<root> <childnode0/> <childnode2/> <!--Comment1--> <childnode3/> <childnode4/> <!--Comment2--> </root>
我知道xpath选择xsl中特定级别的所有注释
string xPath = "/root/comment()";
但是我想选择内部xml为“Comment2”的注释.
有任何想法吗?
谢谢
戴夫
解决方法
这个
/root/comment()[.='Comment2']
似乎工作.