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.
| Parser | Message |
|---|---|
| libxml2 / xmllint | Sequence ']]>' not found |
| Firefox DOMParser | XML 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
<script><![CDATA[ if (a < b) run();
</script><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.
Everything runs in this tab. Nothing you paste is uploaded, logged or sent anywhere. Open your network panel and check.