W3C home > Mailing lists > Public > xml-editor@w3.org > January to March 1999

comment concerning section 2.7 "CDATA Sections" in theXML specif ication

From: <GignacDA@nswccd.navy.mil>
Date: Wed, 10 Feb 1999 11:01:36 -0500
Message-ID: <CF4572E241B4D11197F700A0C9890F7844EC6C@crbenswcex02.dt.navy.mil>
To: xml-editor@w3.org
Section 2.7 "CDATA Sections" states:

	CDATA sections may occur anywhere character data may occur; they are
used to escape
	blocks of text containing characters which would otherwise be
recognized as markup.

I suggest that this be revised along the lines of

	CDATA sections may occur anywhere character data may occur; they are
used to escape
	blocks of text containing characters (other than the CDEnd "]]>")
which would otherwise be
            recognized as markup.

for the following reason. Consider text containing the sentence

	.  .  .  The CDend is "]]>".  .  . .

Suppose this text is to be included in a CD section. Now the following

	<![CDATA[ .  .  .  The CDend is "]]>".  .  . . ]]>

is not acceptable by section 2.4 "Character Data and Markup" which states

	The right angle bracket (>) may be represented using the string
"&gt;", and 
             must, for compatibility, be escaped using "&gt;" or a character
reference when
             it appears in the string "]]>" in content, when that string is
not marking the end
             of a CDATA section.

The above compatibilty refers to lines 14 - of 15 of clause 10.4 "Marked
Section Declaration"
of ISO 8879 (page 392 of Goldfarb's "The SGML Handbook") which states 

	A marked section end that occurs outside of a marked section
declaration is an error.

On the other hand, note that neither

	<![CDATA[ .  .  .  The CDend is "]]&gt;".  .  . . ]]>
nor
	<![CDATA[ .  .  .  The CDend is "]]&#62;".  .  . . ]]>

is acceptable. Section 2.7 "CDATA Sections" states

	Within a CDATA section, only the CDEnd string is recognized as
markup, so that 
	left angle brackets and ampersands may occur in their literal form;
they need not 
	(and cannot) be escaped using "&lt;" and "&amp;".

It follows that the ">" in the "]]>" of	            

	<![CDATA[ .  .  .  The CDend is "]]>".  .  . . ]]>

can not be escaped using "&gt;" or "&#62;".
Received on Wednesday, 10 February 1999 11:01:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:29 GMT