Re: [xml] re-use xmldocPtr

On Mon, Aug 01, 2005 at 09:54:01AM +0200, Remy HAREL wrote:
I have to read several documents, differents from each others, and I 
want to re-use my xmlDocPtr. My main program calls many times a function 
which reads, parses and works on my files.

In this function, I wonder if I can re-initialize my xmlDocPtr without 
xmlFreeDoc and xmlNewDoc for each function call.

  not possible by default. The unit of allocation is the document. You
can reuse parser contexts but not the document nodes. It's all a matter of
having a good memory allocator underneath, which you can change if needed,


Daniel Veillard      | Red Hat Desktop team
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]