如何注释掉XML中的一组标签?

编程入门 行业动态 更新时间:2024-10-23 14:27:56
本文介绍了如何注释掉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中的一组标签?

本文发布于:2023-11-13 00:54:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582963.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   标签   XML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!