Tipworld -> XML
CDATA

I'm often asked what the CDATA tag is and why you'd use it. The CDATA tag is used to mark sections in a document that should not be parsed. That is, if you have a block of data you want the XML parser to ignore, you put in a CDATA section. CDATA sections are primarily used to embed XML samples in XML documents. Here is an excerpt from an XML document that contains samples:

<?xml version="1.0"?>

<!DOCTYPE samples [
<!ELEMENT samples (sample*)>
<!ELEMENT sample (#PCDATA)>
]>

<samples>
 <samples>

  <![CDATA[
  This is a sample of how to use the buffy tag...

  <buffy> slayer </buffy>
  ]]>
 </sample>
</samples>