W3C home > Mailing lists > Public > xml-dist-app@w3.org > October 2000

Re: Issues with Packaging Application Payloads

From: Fredrik Lundh <fredrik@pythonware.com>
Date: Wed, 18 Oct 2000 16:07:51 +0200
Message-ID: <005b01c0390c$ce6ffb50$0900a8c0@SPIFF>
To: "Laird A Popkin" <laird@io.com>
Cc: <xml-dist-app@w3.org>
Laird A Popkin wrote:
> 1) Include the "body" as arbitrary data, terminated by ]]>. This has the
> problem that the body cannot contain the termination string because the
> termination does not nest in XML. Thus, if I try to send a message that
> contains ]]> I terminate the processing of the body early and treat the
> remainder of the body as if it were part of the wrapper

Here we go again...

As I and others have pointed out several times on this list,
all you need to do is to *escape* the delimiter.  Here's one
way to do it:

    <![CDATA[data]]]><![CDATA[]>data]]>

(the first section contains "data]", the second "]>data")

Here's another:

    <![CDATA[data]]>]]&gt;<![CDATA[data]]>

etc.

Writing CDATA sections is no different from putting any other
data in an XML file: if you don't check what you write, you'll
end up producing broken XML files sooner or later.

(And if you do check what you write, it's not that hard to escape
whatever needs to be escaped: <, &, and ]]> in text, ]]> inside
CDATA sections, etc).

</F>
Received on Wednesday, 18 October 2000 10:10:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:57 GMT