XML error reference · XV015

Unterminated comment

A comment was opened with <!-- and never closed with -->.

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 not terminated
Firefox DOMParserXML Parsing Error: unclosed token

What causes it

Everything after `<!--` is swallowed as comment text until `-->` appears, so a missing terminator silently consumes the rest of the document and the parser reports the failure at the very end rather than where the comment began. Typing `<!-` or `--!>` instead of the exact delimiters has the same effect.

See it happen

Triggers the error
<root>
  <!-- todo: fill this in
  <item/>
</root>
Corrected
<root>
  <!-- todo: fill this in -->
  <item/>
</root>

How to fix it

Close the comment with exactly `-->`. Check the whole file for a stray `<!--`, since the reported position is usually far from the real one.

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