Re: [xml] When to call xmlInitParser() ?



On Mon, Oct 01, 2001 at 10:45:42AM +0200, robert wrote:
 >> when i use libxml in a scenario where two or more different
 >> parserContext are created during the runtime of the calling programm,
 >> have i to call xmlInitParser() only once or for each parserContext?
 >I'm just wondering if my question is either too thumb or too tough to
 >take note of!?  If first option fits, please forgive my ignorance and
 >answer anyhow, i'll confess my shame if i should have hit on it on my
 >own...  8)

Sorry about that, sometimes we're all a bit busy :)

To answer your question: you should only call xmlInitParser() once.

  Actually it's not needed at all in most cases, the first time parsing is
done stuff is initialized when needed.

However, it doesn't hurt to call it multiple times (unless you are running
in a multi-threaded environment, which you don't :), it guards itself
against that.

  Yes, unless you called xmlCleanupParser ()
This is explained in http://xmlsoft.org/xmlmem.html#cleanup

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




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