Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Business Industries Finance Tax

Home > CDATA section


A CDATA section or character data section is a section in an XML document which is marked for the parser to interpret as character data and not markup. A CDATA section starts with the following sequence:

[CDATA[

and ends with this sequence:

]]>

All characters enclosed between these two sequences are interpreted as characters, not markup or entity references. For example, in a line like this:

John Smith

the opening and closing "sender" tags are interpreted as markup. If, however, they are written like this:

[CDATA[John Smith]]>

they will have exactly the same status as "John Smith"—text. Similarly, if ð appears in an XML document normally, it will be parsed as a reference for the Unicode character U+00F0 (small letter eth), but if the same appears in a CDATA section, it will be parsed as ampersand, hash mark, 240, semicolon.

CDATA sections are useful for writing XML code as data. For example, if one wishes to typeset a book with XSL explaining the use of an XML application, the XML markup to appear in the book itself will be written in the source file in a CDATA section.

XML



Non User