36 chars · 1 line
Waiting for input
36 chars · 1 line
Waiting for input
XML comment syntax
The sample comment is closed, but its content contains -- before the terminator. XML reserves the double-hyphen sequence for comment syntax and does not allow it inside comment text. This tool is free to use. No account or payment is required.
Last updated
XML comment grammar also constrains the content between <!-- and -->. An internal -- sequence violates that grammar even when the parser can see an apparent closing delimiter later.
If application data is inserted into XML comments, sanitize or avoid comment serialization for values that can contain arbitrary hyphen sequences.
Replace the internal -- sequence with comment-safe text.
<root><!-- bad -- comment --></root><root><!-- bad - comment --></root>Common questions
No. XML comment content cannot contain a double-hyphen sequence.
Yes, provided the comment text itself contains no forbidden -- sequence.
Yes, as long as their content and delimiters remain valid.
Debugging a specific XML issue? Browse XML troubleshooting.