Re: [xml] xmlDocContentDumpOutput() should be exposed in API

On Fri, Sep 13, 2002 at 01:33:36PM +0200, Michel GOUGET wrote:
I am writing a wrapper for outputting a document to a (privately defined) memory buffer list. I followed 
the example, and used my own xmlOutputBufferPtr with my private structure (struct smgbuflist ) in the 
context member. I ended up with the following piece of code - plagiarized from xmlSaveFormatFileEnc() :-)

int save_format_xml_to_buflist(xmlDocPtr pdoc, struct smgbuflist *pbl, const char *encoding, int format)
    if(!(pob=mg_buflist_outputbuffer_new(pbl, handler)))GOTO_ERROR;
    xmlDocContentDumpOutput(pob, pdoc, encoding, format);

Unfortunately, xmlDocContentDumpOutput() is static to tree.c.
I made it global and added its declaration in tree.h , and everything runs smoothly.

I think that this function should be exposed, as it is *the* primitive for doing any kind of output.

Any comments?

  Use xmlSaveFileTo(), it will also call the close callback of your I/O
buffer at the end. No need to increase the API size in this case.


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]