Re: SVGT 1.2: CDATA blocks for scripts

On Jan 17, 2006, at 12:48 PM, Chris Lilley wrote:

> 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.

This is really not a big deal, but it seems completely arbitrary that  
the spec uses CDATA for all <script> elements and not for any  
<handler> elements. There's nothing in the contents of any of the  
scripts that would cause CDATA to make a difference. I think it would  
be better to either always use CDATA, or only when needed. But I am  
satisfied with no change, since this is purely an editorial matter.

Regards,
Maciej

Received on Tuesday, 31 January 2006 03:19:25 UTC