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.
| Parser | Message |
|---|---|
| libxml2 / xmllint | Comment not terminated |
| Firefox DOMParser | XML 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
<root>
<!-- todo: fill this in
<item/>
</root><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.
Everything runs in this tab. Nothing you paste is uploaded, logged or sent anywhere. Open your network panel and check.