Re: [xml] writing an xmlNodePtr to a char* (or xmlChar)

On Mon, Mar 04, 2002 at 10:52:35PM +0000, Martyn Russell wrote:
Is it possible to take a particular node and write the output of the
tree to a char* ?

  Hum not directly,

I have seen the function xmlNodeDumpOutput, should I use this? Or is the
only function closely available for this xmlDocDumpMemory?

  The simplest is to use xmlNodeDump() and get the string from the buffer.
If you really want to serialize to a given buffer without copy, the best is
to build an xmlOutputBufferPtr() specific to the semantic needed and then
use xmlNodeDumpOutput(), but this require you write the specific callbacks
for the xmlOutputBufferPtr semantic.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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