Re: [xml] Multiple CDATA blocks



On Thu, Sep 02, 2004 at 09:13:17PM +0200, Philip Van Hoof wrote:
On Thu, 2004-09-02 at 14:45 -0400, Daniel Veillard wrote:

On Thu, Sep 02, 2004 at 06:35:07PM +0200, Philip Van Hoof wrote:
So basically, yea I know that you people are going to slaughter me using
an axe after tearing of my fingernails one by one and worst of all
really really going to hate me for using this older libraries.

  No it's even simpler than that, I don't want to hear about it.

Okay :-)

Since the older gnome-xml isn't parsing it correctly for me, I assume
that I can't do much about it.

  Yup, tweaking the input is the simplest

So in stead of letting libxml-2 handle the situation of a "]]>" in my
CDATA-body by creating two such blocks, I decided to replace it with 

      "]]>"


  Hum ... Since what you are embedding in the CDATA section is XML
with a CDATA section, I don't think you can do that without some
escaping. That's one way to do it.

Could it be that this is behaviour of libxml-2 when in my data, the
string "]]>" is found?

  Yes that's the usual way to proceed, e.g.
    http://www.w3.org/TR/xslt#section-XML-Output-Method
see the paragraphs suggesting this.

For now I've created a small check-data for "]]>" at the writer side and
a "undo-that-check"-type of function at the reader-side:

  yup.

This solves my problem for now, nevertheless I am open for better
suggestions from the mailinglist of course. Lucky me we have all the
memory and cpu-power we want, I'd dislike using this for high-
performance situations :-\

  You could also use another simpilar escaping like turning one
of the ] into ] but I don't see how to avoid escaping.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]