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

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 UTC