3
我试图从一个文档继承一些XML到另一个,但我希望它在它到达时被注释掉。所以,我想要做这样的事情:XSLT注释标记不输出内容?
<xsl:template name="process">
<figure>
<xsl:comment>
<xsl:copy />
</xsl:comment>
</figure>
</xsl:template>
当我运行它使用直的Java XSLT处理器,我得到的线沿线的东西:
<figure>
<!--
-->
</figure>
奇怪的是,如果我跑它没有评论对象,如:
<xsl:template name="process">
<figure>
<xsl:copy />
</figure>
</xsl:template>
内容通过就好了。
任何想法?我想也许你不能在评论中使用元素,但我查了一下,它应该没问题。
+1的一个很好的答案。祝你节日快乐! :) –
谢谢@Dimitre。你也是! – Tomalak
这绝对解决了这个谜团。非常感谢,Tomalak! – NickChase