Re: Document cleanup suggestions

John Cowan wrote:

> Only if your writeOut method is unacceptably naive.  The writeOut method for
> Text-not-CData objects should emit "<" as "&lt;" and "&" as "&amp;", and the
> writeOut method for CData should emit "]]>" as "]]&gt;".

Actually, I believe that it is Text-not-CData that needs to emit "]]>" as
"]]&gt;" (see [14] in the XML spec, as referenced by [43]).

CData needs to replace "]]>" with something like "]]]]><![CDATA[>" because CDATA
sections cannot nest.  Breaking up the section seems to be the only way to
preserve the characters, since &gt; would not be interpreted inside the CDATA
section (see section 2.7).

Ray Whitmer
ray@imall.com

Received on Monday, 17 August 1998 17:32:18 UTC