本文介绍了通过xpath / xsl中的内部xml选择注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给出以下xml文档
<root>
<childnode0/>
<childnode2/>
<!--Comment1-->
<childnode3/>
<childnode4/>
<!--Comment2-->
</root>
我知道xpath可以选择xsl中特定级别的所有注释
I know the xpath to select all the comments at a particular level in xsl
string xPath = "/root/comment()";
但是我想选择内部XML为 Comment2的注释。
However i'd like to select a comment where the inner xml is "Comment2".
有什么想法吗?
谢谢
戴夫
推荐答案
此
/root/comment()[.='Comment2']
似乎可以正常工作。
这篇关于通过xpath / xsl中的内部xml选择注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!