W3C home > Mailing lists > Public > www-svg@w3.org > January 2006

Re: SVGT 1.2: CDATA blocks for scripts

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 30 Jan 2006 19:19:16 -0800
Message-Id: <3AA4F8EB-7329-4F5D-8476-3EDA3BBF1942@apple.com>
Cc: www-svg@w3.org
To: Chris Lilley <chris@w3.org>


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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:33 GMT