On Fri, Mar 28, 2008 at 06:50:32PM +0530, Nagesh wrote:
> Hi All,
> 
>        Is there any way, I can re-use the already created parser context
> (ex: xmlCreateMemoryParserCtxt) to perform SAX parsing of more than one xml
> document without freeing and creating the parser context again. I tried
> using xmlSetupParserForBuffer( ), but apparently it handles only the case in
> which the encoding of the XML document is UTF-8. Any other encoding is
> currently not supported by xmlSetupParserForBuffer( ). 

  create your XML parser context, then use xmlCtxtReadMemory()
(assuming parsing from memory) for each document with the same parser
  http://xmlsoft.org/html/libxml-parser.html#xmlCtxtReadMemory

The xmlCtxtRead... functions uses xmlCtxtReset() to cleanup existing state
left from previous parsing

Daniel
    

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to