如何注释掉XML中的一组标签? [英] How do I comment out a block of tags in XML?
本文介绍了如何注释掉XML中的一组标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在XML中注释掉一个标记块?
How do I comment out a block of tags in XML?
如何在以下代码中注释< staticText>
及其中的一切内容?
I.e. How can I comment out <staticText>
and everything inside it, in the code below?
<detail>
<band height="20">
<staticText>
<reportElement x="180" y="0" width="200" height="20"/>
<text><![CDATA[Hello World!]]></text>
</staticText>
</band>
</detail>
我可以使用<! - staticText - >
但是这只是为单个标签(如我所知),如 //
在Java和C.我想要更像一个如何 / ** comment ** /
可以在Java和C中使用,因此我可以注释掉更长的XML代码块。
I could use <!-- staticText-->
but that's just for single tags (as what I know), like //
in Java and C. I would like something more like how /** comment **/
can be used in Java and C, so I can comment out longer blocks of XML code.
推荐答案
您可以在多行(也存在于HTML中)使用该样式的注释
You can use that style of comment across multiple lines (which exists also in HTML)
<detail>
<band height="20">
<!--
Hello,
I am a multi-line XML comment
<staticText>
<reportElement x="180" y="0" width="200" height="20"/>
<text><![CDATA[Hello World!]]></text>
</staticText>
-->
</band>
</detail>
这篇关于如何注释掉XML中的一组标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文