Lists Home |
Date Index |
- From: "Borden, Jonathan" <email@example.com>
- To: "XML Dev" <firstname.lastname@example.org>
- Date: Sat, 20 Feb 1999 14:54:23 -0500
John Cowan wrote:
> Robert Hanson wrote:
> > Am I wrong in saying that the answer would be that the symbol
> ">" should not
> > show up in the non-XML text anyway? Wouldn't it be converted
> to an entity
> > reference? Like this...
> > "]]>" in the text body would become "]]>"
This is of course how the text "]]>" would be escaped in a text block. The
issue of dealing with "]]>" arises when we are in a CDATA block. In this
case "]]>" remains CDATA, so John's suggestion about creating two CDATA
sections is a good one.
> The point was that conversions like ">" becomes ">" aren't
> necessary if you use CDATA sections, only the one bad case of
> "]]>" which is illegal in plain XML character data as well as
> terminating the CDATA section, and so must become something like
> "]]]]><![CDATA[<", which is "]]" followed by "]]>" to end the
> CDATA section plus "<![CDATA[" to start another CDATA section
> plus ">". There are other ways to do it, of course.
What I have done in XMTP is to CDATA all text based non-xml bodies (i.e.
mime:BODY) but escape the text nodes of mime headers. e.g. Message-ID:
<Message-ID ><sample@somewhere></Message-ID >
as opposed to:
<Message-ID ><[CDATA[<sample@somewhere>]]></Message-ID >
just because, at the moment, this results in an average slightly larger
document (granted just a few bytes) and also because of vague stylistic
leanings. The best reason to <[CDATA[ the bodies is that it makes looking at
enclosed HTML ever so much easier.
Is there a good reason to prefer one over the other for headers?
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)