Possible Duplicate:
what is the meaning of CDATA
What is, and when is used the ![CDATA[ string/variable/constant? (I don't know what is it)
Possible Duplicate:
what is the meaning of CDATA
What is, and when is used the ![CDATA[ string/variable/constant? (I don't know what is it)
It is a way to escape large sections of text in XML documents.
From wikipedia:
In an XML document or external parsed entity, a CDATA section is a section of element content that is marked for the parser to interpret as only character data, not markup.
By the way, it is <![CDATA[]]>
, not ![CDATA[]]
.
The term CDATA ((Unparsed) Character Data) is used about text data that should not be parsed by the XML parser.
Some text, like JavaScript code, contains a lot of "<" or "&" characters. To avoid errors script code can be defined as CDATA.
CDATA is used in XML (and hence XHTML) to insert text which might include "special" characters (eg. < and >) which would normally break the XML parser (and to be fair, confuse a human reader, as well!).
For example, you could use it to embed a code segment inside an XML document.