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




-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: Monday, October 01, 2001 12:01 PM
To: robert
Cc: Henke, Markus; 'xml gnome org'
Subject: 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

Thank you, Daniel.
Defacto i havn't searched the doc of the memory-interface for that problem.
Silly me, cause that's a good point to search (if one have the right
perspective...  8)




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