| Previous | Next
CDATA SectionsWhen an XML document includes samples of XML or HTML source code, the < and & characters in those samples must be encoded as For example, in a Scalable Vector Graphics (SVG) tutorial written in XHTML, you might see something like this: <p>You can use a default <code>xmlns</code> attribute to avoid having to add the svg prefix to all your elements:</p> <![CDATA[ <svg xmlns="http://www.w3.org/2000/svg" > <ellipse rx="110" ry="130" /> <rect x="4cm" y="1cm" /> </svg> ]]> The SVG source code has been included directly in the XHTML file without carefully replacing each The only thing that can not appear in a CDATA section is the CDATA section end delimiter CDATA sections exist for the convenience of human authors, not for programs. Parsers are not required to tell you whether a particular block of text came from a CDATA section, from normal character data, or from character data that contained entity references such as |