You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Johannes Lipp <jo...@gmx.net> on 2000/09/08 22:21:09 UTC

Bug in nesting CDATA sections ?!?

Hi,

I have noticed strange behaviour of Xerces-C in relation with nested (or
not)
CDATA sections.

I'm a user of Xerces-C, not a developer of it. I know that this might not
be
the right place for a bug report, but the bug tracking system and the mail
archive are down, so I ended up here.

It seems to me that Xerces is too picky about nesting CDATA sections.
If I feed the following document into Xerces,

	<?xml version="1.0"?>
	<!DOCTYPE CdataBegInCdata [
		<!ELEMENT CdataBegInCdata (#PCDATA)>
	]>
	<CdataBegInCdata>
		<![CDATA[
			<![CDATA[
		]]>
	</CdataBegInCdata>

I get the error message

	Nested CDATA sections are not allowed
	
Now the question is: does this document contain nested CDATA sections?

Section 2.7 of the XML 1.0 specification
(http://www.w3.org/TR/1998/REC-xml-19980210) says:

	[21] CDEnd ::= ']]>'

	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;". CDATA sections cannot nest.

If Xerces finds nested CDATA sections in the above document, it seems to
me
that it recognizes the second <![CDATA[ as markup in the CDATA section,
which it shouldn't do according to the specifications.

I checked this with the nightly build from 2000-09-08.

Has anybody noticed this before?
Did I get the specification wrong?

Thanks in advance for any comments.

Regards,
Johannes

-- 
Sent through GMX FreeMail - http://www.gmx.net


Re: Bug in nesting CDATA sections ?!?

Posted by Andy Heninger <an...@jtcsv.com>.
You are right.  I've just put in a fix.

Andy Heninger
IBM XML Technology Group, Cupertino, CA
heninger@us.ibm.com


----- Original Message -----
From: "Johannes Lipp" <jo...@gmx.net>
To: <xe...@xml.apache.org>
Sent: Friday, September 08, 2000 1:21 PM
Subject: Bug in nesting CDATA sections ?!?


> Hi,
>
> I have noticed strange behaviour of Xerces-C in relation with nested (or
> not)
> CDATA sections.
>
> I'm a user of Xerces-C, not a developer of it. I know that this might
not
> be
> the right place for a bug report, but the bug tracking system and the
mail
> archive are down, so I ended up here.
>
> It seems to me that Xerces is too picky about nesting CDATA sections.
> If I feed the following document into Xerces,
>
> <?xml version="1.0"?>
> <!DOCTYPE CdataBegInCdata [
> <!ELEMENT CdataBegInCdata (#PCDATA)>
> ]>
> <CdataBegInCdata>
> <![CDATA[
> <![CDATA[
> ]]>
> </CdataBegInCdata>
>
> I get the error message
>
> Nested CDATA sections are not allowed
>
> Now the question is: does this document contain nested CDATA sections?
>
> Section 2.7 of the XML 1.0 specification
> (http://www.w3.org/TR/1998/REC-xml-19980210) says:
>
> [21] CDEnd ::= ']]>'
>
> 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;". CDATA sections cannot nest.
>
> If Xerces finds nested CDATA sections in the above document, it seems to
> me
> that it recognizes the second <![CDATA[ as markup in the CDATA section,
> which it shouldn't do according to the specifications.
>
> I checked this with the nightly build from 2000-09-08.
>
> Has anybody noticed this before?
> Did I get the specification wrong?
>
> Thanks in advance for any comments.
>
> Regards,
> Johannes
>
> --
> Sent through GMX FreeMail - http://www.gmx.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>