The CDATA Section

Sometimes you might want to prevent a parser from interpreting a portion of an XML document. For example, you might want to display the XML code in another XML document without interpretation. In this case, you can use a CDATA section.

A CDATA section works similar to <pre>...</pre> in HTML. All white spaces and characters within the CDATA section are not interpreted as XML code. The syntax of a CDATA section is:

    <![CDATA[ and ends with ]]>

For example:

    <![CDATA[text and markup that will not be parsed]]>

Note that the CDATA sections cannot be nested.

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!-- This is the first message in the document -->
   <message>
        <priority type="urgent"/>
        <to>you@yourAddress.com</to>
        <from>me@myAddress.com</from>
        <code>
        <![CDATA[<tag> content </tag>]]>
        </code>
        <subject >Car lights on</subject>
        <?cocoon-process type="xslt"?>
        <body type=" text without graphic">
         Owner of vehicle with license plate
         454-561, your lights are on!
        </body>
    </message>

Click the Next button to continue.