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.

ParserMessage
libxml2 / xmllintComment must not contain '--' (double-hyphen)
Java SAXParserThe 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

Triggers the error
<notes>
  <!-- ---- section ---- -->
</notes>
Corrected
<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.

Input
WaitingPaste a document to check it. Validation runs as you type.

Everything runs in this tab. Nothing you paste is uploaded, logged or sent anywhere. Open your network panel and check.

Tools that catch this

Background reading

Errors this fixes

Every XML error, explained