27 chars · 1 line
Waiting for input
27 chars · 1 line
Waiting for input
XML CDATA troubleshooting
The sample opens CDATA before 1 < 2 but never emits ]]> before the root closing tag. Once CDATA starts, markup-like characters are treated as text until the exact CDATA terminator appears. This tool is free to use. No account or payment is required.
Last updated
Inside CDATA, characters such as < and & can appear as text without normal escaping. That special parsing mode continues until ]]> is found, so a missing terminator can make later closing tags disappear into text from the parser's point of view.
If the source text itself contains ]]>, split the content into multiple sections or serialize the data another way rather than nesting or escaping the terminator inside one CDATA section.
Close CDATA before the root closing tag.
<root><![CDATA[1 < 2</root><root><![CDATA[1 < 2]]></root>Common questions
CDATA starts with <![CDATA[ and ends with ]]>.
Yes. That is one common reason to use CDATA for text-like payloads.
No. CDATA sections do not nest.
Debugging a specific XML issue? Browse XML troubleshooting.