|CDATA blocks have been provided as a convenience measure when you want to include large blocks of special characters as character data, but you do not want to have to use entity references all the time. CDATA sections are used to escape blocks of text containing characters, which would otherwise be recognized as markup. Whatever written inside CDATA section will be ignored by the XML parser. All tags and entity references are ignored by an XML processor that treats them just like any character data. CDATA means Character Data and XML Parsers ignore anything enclosed within CDATA section.|
|Remember the parser ignores everything inside a CDATA section.|
|Uses of CDATA sections|
|Remember, a CDATA section cannot contain the string “]] >” and therefore it is not possible for a CDATA section to contain nested CDATA sections.CDATA sections are useful for writing XML code as text data within an XML document. 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.
For example, to encode “]] >” one would write:
if (amount<=5000) then