Search code examples
xmlcdata

How do i write the literal "]]>" inside a CDATA section without it ending the section


Pretty simple question, I'm writing an XML document and i'm not sure how to write "]]>" without it being seen as the end of the section.


Solution

  • You can do it like this:

    ]]>]]&gt;<![CDATA[
    

    This ends up breaking the CDATA section in two parts, but it's what you have to do.