CDATA Sections

An XML document may contain information expressed in a non-XML syntax. The XML mechanism for indicating that such content is not to be parsed as XML is the CDATA section.

The starting delimiter of a CDATA section is the character sequence <![CDATA[. The ending delimiter is the character sequence ]]>. The character sequence ]]> cannot be used as the content of a CDATA section.

CDATA sections can be used to store XML code, such as code snippets used in this book, without having to escape all characters that an XML processor would recognize as markup. For example, if the text of this chapter were written and stored in XML, you would not want example code to be parsed. Thus, if you wanted to create in XML the text for a section of ...

Get Sams Teach Yourself XML in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.