CDATA

from Wikipedia, the free encyclopedia

CDATA ( Engl. Character Data ) is a keyword in SGML and XML . CDATA is used to identify character data whose content is not analyzed by the parser.

CDATA section

A CDATA section tells a parser that there is no markup to follow, but normal text. The CDATA section has the following syntax:

<![CDATA[Inhalt]]>

The CDATA section can also contain markup characters ( <, >and &). These are no longer interpreted by the parser. The closing character sequence ]]>must not be used within content .

If ]]>the content is still required, the CDATA section is divided into two separate parts, separating the character string in front of ]>or in front of it >:

<![CDATA[...]]]><![CDATA[]>...]]>
<![CDATA[...]]]]><![CDATA[>...]]>

CDATA sections are used in XHTML ( XML ) when long computer programs or even XML code are to be integrated over a larger area. This eliminates the need to use predefined entities such as &lt;and &amp;.

CDATA data type

In a document type definition (DTD), CDATA is a data type of an attribute declaration, for example:

<!ATTLIST img
   src    CDATA    #REQUIRED
>

See declarations of attributes .

See also

Web links