Xml – How to comment a single line in XML


This rather is a verification just not to miss out.

Is/n't there a line-comment in XML? So, one without a closer, like "//" the compiler uses.

I saw How do I comment out a block of tags in XML? and several other discussions.

This type of comment would be practical to comment out a line without bothering its closer somewhere down.

Best Solution

No, there is no way to comment a line in XML and have the comment end automatically on a linebreak.

XML has only one definition for a comment:

'<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

XML forbids -- in comments to maintain compatibility with SGML.