Re: [xml] Generating streaming XML via tree API

On Thu, Sep 28, 2006 at 09:39:30AM -0500, David Hagood wrote:

  Sorry there is no code in libxml2 for that. Basically any API here which
will write the open tag will also write the closing tag, ... unless you
use the xmlWriter

I realize that I may not be able to write the document level tag this way. I

  The library has no API to save non balanced XML Fragment, this is
a feature to avoid some of the horrors you can see around.

And I can certainly understand that - and that really is not what I am
asking for.

What I want is an API which can accept an xmlNodePtr, and write it and its
children out. The node shall be balanced, closed, etc.

  There is a streaming writing API: the xmlWriter

Which, as far as I can see, does not have an API to accept an xmlNodePtr
and write a balanced tag and all its children out. In fact, it looks to me
like xmlWriter is really little better than printf'ing the tags out - but
perhaps I am missing something.

Obviously, within the existing library there is code that can take a
nodeptr and write it out - perhaps that code is not exported. Perhaps it
should be.

So, what it boils down to is, is there a routine that will do this, or am
I stuck writing my own version that will walk the node list and write it

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