CDATA
CDATA
Main page

CDATA

logo
Community Hub0 subscribers
What are your thoughts?
Be the first to start a discussion here.
Be the first to start a discussion here.
CDATA

The term CDATA, meaning character data, is used for distinct, but related, purposes in the markup languages SGML and XML. The term indicates that a certain portion of the document is general character data, rather than non-character data or character data with a more specific, limited structure.

In an XML document or external entity, a CDATA section is a piece of element content that is marked up to be interpreted literally, as textual data, not as marked-up content. A CDATA section is merely an alternative syntax for expressing character data; there is no semantic difference between character data in a CDATA section and character data in standard syntax where, for example, "<" and "&" are represented by "&lt;" and "&amp;", respectively.

A CDATA section starts with the following sequence:

and ends with the next occurrence of the sequence:

All characters enclosed between these two sequences are interpreted as characters, not markup or entity references. Every character is taken literally, the only exception being the ]]> sequence of characters. In:

the start and end "sender" tags are interpreted as markup. However, the code:

is equivalent to:

Thus, the "tags" will have exactly the same status as the "John Smith"; they will be treated as text.

See all
User Avatar
No comments yet.