XML error reference · XV016
Double hyphen inside a comment
The sequence -- appears inside a comment, which XML forbids.
What your parser calls it
The same problem, reported differently by each parser. If you arrived here from one of these strings, you are in the right place.
| Parser | Message |
|---|---|
| libxml2 / xmllint | Comment must not contain '--' (double-hyphen) |
| Java SAXParser | The string "--" is not permitted within comments. |
What causes it
For compatibility with SGML, the string `--` may not appear anywhere inside a comment, and a comment may not end with `--->`. This bites when commenting out a block that already contains a comment, or when using a row of hyphens as a visual separator.
See it happen
<notes>
<!-- ---- section ---- -->
</notes><notes>
<!-- ==== section ==== -->
</notes>How to fix it
Break the hyphens up, use a different separator character, or restructure so the comment does not contain `--`. XML comments do not nest, so commenting out a region that already contains comments needs the inner ones removed.
Fix your own document
Paste your own document below. Press Sample if you want the broken example above loaded instead. Nothing you paste leaves this tab.
XML Validator
Well-formedness and schema validation. Nothing is uploaded.
Everything runs in this tab. Nothing you paste is uploaded, logged or sent anywhere. Open your network panel and check.