XML error reference · XV017

Unterminated CDATA section

A CDATA section was opened with <![CDATA[ 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 / xmllintSequence ']]>' not found
Firefox DOMParserXML Parsing Error: unclosed CDATA section

What causes it

As with comments, the parser consumes everything to the end of the input looking for the terminator. A misspelled opener, lowercase `cdata` or a missing bracket, produces the same failure, because CDATA is case sensitive and the delimiter is exactly `<![CDATA[`.

See it happen

Triggers the error
<script><![CDATA[ if (a < b) run();
</script>
Corrected
<script><![CDATA[ if (a < b) run(); ]]></script>

How to fix it

Close the section with `]]>`. If the content itself needs to contain `]]>`, split it across two CDATA sections, breaking between the `]]` and the `>`.

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