-
CDATA Sections in XML
CDATA sections may occur anywhere character data may occur and they are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string "<![CDATA[" and end with the string "]]>":]
CDATA Sections can be divided into four parts:
1. CDSect ::= CDStart CData CDEnd
2. CDStart ::= '<![CDATA['
3. CData ::= (Char* - (Char* ']]>' Char*))
4. CDEnd ::= ']]>'
Within a CDATA section, only the CDEnd string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using "<" and "&". CDATA sections cannot be nested.
An example of a CDATA section, in which "<greeting>" and "</greeting>" are recognized as character data, not markup:
Code:
<![CDATA[<greeting>Hello, world!</greeting>]]>
Page generated in 1,713,561,722.40285 seconds with 10 queries