Table of Contents

XML - Character data (CDATA) - Escape

About

All text that is not markup or comment constitutes the character data of the document (known as CDATA).

CDATA is just like PCDATA, except the parser will not expect child XML content to be embedded in it.

How to escape / add reserved character in your document ?

If you want to embedded reserved characters xml character in your document, you need to enclose them in a cdata section.

An example of a CDATA section, in which

and

are recognized as character data, not xml markup:

<![CDATA[<greeting>Hello, world!</greeting>]]>