How do I comment out a block of tags in XML?
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>
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.
The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags.
If you want to comment out a single line in the XML code, insert your cursor at the beginning of a line you want to comment out. Type a less-than symbol followed by an exclamation point and two dashes. Move your cursor to the end of the line and then type two dashes followed by a greater-than symbol.
Allows notes and other human readable comments to be included within an XML file. XML Parsers should ignore XML comments. Some constrains govern where comments may be placed with an XML file.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With