W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

Re: Document cleanup suggestions

From: Ray Whitmer <ray@imall.com>
Date: Mon, 17 Aug 1998 15:32:16 -0600
Message-ID: <35D8A160.46489695@imall.com>
To: DOM List <www-dom@w3.org>

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
Received on Monday, 17 August 1998 17:32:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:04 UTC