CDATA stands for Character Data. CDATA opening/closing tag between data that could be interpreted as XML markup, but not actually.

You can use for escaping some characters, otherwise this will be treated as regular XML.

How to write CDATA in XML

Syntactically, CDATA behavior similar to a comment still 3 minor different between CDATA and Comment,

  • CDATA is a part of document while comment is not a part of document.

  • Both syntax are different.

  • Entities are recognize in CDATA while comment is not recognize.

CDATA Syntax

XML CDATA section you can write by following syntax,

  ------ CDATA Section Code ------
  ------ CDATA Section Code ------

CDATA Example

<?xml version="1.0" encoding="UTF-8"?>
  <emp_info id="1">
    This is the CDATA area.
    You can storing special character that are recognize. Ex. '  " & < >

Run it...   »

Example Result: