[ expat-Bugs-449518 ] ]]> in non-CDATA content causes error

noreply@sourceforge.net noreply@sourceforge.net
Thu, 09 Aug 2001 09:35:23 -0700


Bugs item #449518, was opened at 2001-08-09 08:35
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=449518&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: ]]> in non-CDATA content causes error

Initial Comment:
The three characters ]]> in the body of an XML
document, but outside of a CDATA section, cause a
parser error, as can be seen by parsing:

<a>foo]]></a>

Which is valid XML. The XML REC has the following to say:

[In the content of elements, character data is any
string of characters which does not contain the
start-delimiter of any markup. In a CDATA section,
character data is any string of characters not
including the CDATA-section-close delimiter, "]]>".]
QED, expat has this wrong.

Matt Sergeant.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-08-09 09:35

Message:
Logged In: NO 

But consider this production:

CharData    ::=    [^<&]* - ([^<&]* ']]>' [^<&]*) 

And:

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.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=449518&group_id=10127