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

Re: SVGT 1.2: CDATA blocks for scripts

From: Chris Lilley <chris@w3.org>
Date: Tue, 17 Jan 2006 21:48:55 +0100
Message-ID: <1563155039.20060117214855@w3.org>
To: www-svg@w3.org
Cc: Maciej Stachowiak <mjs@apple.com>

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.

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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:06 UTC