Re: SVGT 1.2: CDATA blocks for scripts

Hello www-svg,

Maciej Stachowiak <mjs@apple.com> writes:

> The one <script> example encloses the script body on <![CDATA
> [   ... ]]>, but none of the <handler> examples do. Is this meant to  
> imply a meaningful difference in either content model or recommended  
> best practices for <script> and <handler>? If not, then either the  
> difference should be either removed or the reason for its presence  
> should be explained.

CDATA marked sections are a standard part of XML; all XML parsers will
handle them. The advantage is that < " & etc are not treated specially,
only the end of marked section ]]> is significant.
http://www.w3.org/TR/REC-xml/#sec-cdata-sect

Elements cannot be declared with a CDATA content model.

The choice of whether to enclose script blocks in CDATA marked sections,
or to escape troublesome characters like < and & as &lt; &amp;
individually, is up to the document author.

-- 
 Chris Lilley                    mailto:chris@w3.org
 Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Tuesday, 17 January 2006 20:49:11 UTC