Re: [xml] Reusing xmlParserCtxt

On Wed, Oct 11, 2006 at 11:16:21AM +0530, harbhanu wrote:

Can we reuse the context created(by call to xmlCreateMemoryParserCtxt)
inside xmlSAXUserParseMemory, to parse another document..??


What I have observed that some information regarding current parsing is
stored in the xmlParserCtxt structure.

So, once parsing of a document is done, can the same context be safely
reused to parse another document.?


Is there a reset API to bring back the used context to the initial state?

  Initial no, the reset is complete, inputs included:
Once you have started parsing you cannot go back on input, it's a new parse.

The functions xmlCtxtRead... are specifically designed for reuse on multiple

Trying to reuse contexts with other functions is not garanteed, simply because
I didn't tested those, you will have to try and possibly debug.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]