Skip to content
XML

CDATA Sections

Escape blocks of literal text.

#cdata#escaping

Code

xml
<?xml version="1.0"?>
<content>
  <code><![CDATA[
    if (x < 5 && y > 3) {
      console.log("<not a tag>");
    }
  ]]></code>
  <text>Normal text uses &amp; &lt; &gt; for escaping</text>
</content>