How to Comment in Xml?

How to Comment in Xml?

Syntax. An XML comment should be written as: <! -- Write your comment-->

How do I comment out a line in XML?

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.

Can you comment out XML?

5 Answers. No, there is no way to comment a line in XML and have the comment end automatically on a linebreak. XML forbids -- in comments to maintain compatibility with SGML.

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.