[Expat-discuss] Text data handler

Shen, Lin lshen at cisco.com
Fri May 21 18:33:34 EDT 2004


What's the difference between resetting a parser and destroying and
re-creating a parser for parsing a different document? I guess it's
mainly performance. Will a parser context be lost when it's reset? 

Lin shen
Cisco Systems 

> -----Original Message-----
> From: expat-discuss-bounces at libexpat.org 
> [mailto:expat-discuss-bounces at libexpat.org] On Behalf Of Greg Martin
> Sent: Friday, May 21, 2004 3:24 PM
> To: expat-discuss at libexpat.org
> Subject: RE: [Expat-discuss] Text data handler
> 
> 
> 
> 
> > -----Original Message-----
> > From: Shen, Lin [mailto:lshen at cisco.com]
> > Sent: Friday, May 21, 2004 4:18 PM
> > To: Greg Martin; expat-discuss at libexpat.org
> > Subject: RE: [Expat-discuss] Text data handler
> > 
> > 
> > I want to parse multiple documents one by one.
> > What I'm doing right now is to call XML_ParseCreate() once at
> > the very beginning, and then call XML_Parse() for each 
> > document. I've tried setting the 4th parameter to both FALSE 
> > and TRUE, but always get "junk after document element at 
> > line" error when the second document gets fed into the parser.  
> > 
> 
> Right, you need to call XML_ParserReset and then re-register your 
> handlers before calling XML_Parse again. You can call XML_Parse as 
> many times as you want on a single document for the same parser but 
> must re-initialise the parser before starting a new document. 
>  
> 
> 
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
> 



More information about the Expat-discuss mailing list