Tuesday, February 5, 2008

]]> Inside CDATA Section

Ever needed to put ]]> inside a CDATA section? Here's how.

Seems like there are two ways actually:

  • escape the '>' character as >
  • split the CDATA section into two sections:
    <![CDATA[A CDATA text with a ]]]]><![CDATA[> in it]]>


Cool! (It demanded a little more escaping from me to make the above look as it looks ;) )

Based on: How can I have ']]>' as a text inside CDATA in xml


No comments: