You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Shirish M. Kulkarni" <sh...@ptc.com> on 2001/12/24 09:14:19 UTC

Re: Single instance of Xerces parser for multiple parse() calls in an application

Jas :

Thanks for your inputs.

> In my experience this is true only as long as you parse documents that
> do not generate parse errors. Once you hit an error, reset() no longer
> works properly and you have to create a new parser intstance.
>
> I hope this has changed, but when I was attempting this for the
> conformance testing suite I was forced into creating a new parser
> instance for each file, which seemed an aweful waste of resources.

This indeed seems to have changed in Xerces v1.5.1. I was able to
successfully use same instance of parser, even after generating
exceptions.

I would invite comments from someone from Xerces development ( apache.org
or ibm.com ) to autheticate our findings.

--
With best regards,

Shirish


Re: Single instance of Xerces parser for multiple parse() calls in an application

Posted by Tinny Ng <tn...@ca.ibm.com>.
With single instance of parser, you can can parse() multiple times.  The
parser in fact will call 'reset()' internally everytime, so you don't really
need to call 'reset()' before re-use.

Tinny

"Shirish M. Kulkarni" wrote:

> Jas :
>
> Thanks for your inputs.
>
> > In my experience this is true only as long as you parse documents that
> > do not generate parse errors. Once you hit an error, reset() no longer
> > works properly and you have to create a new parser intstance.
> >
> > I hope this has changed, but when I was attempting this for the
> > conformance testing suite I was forced into creating a new parser
> > instance for each file, which seemed an aweful waste of resources.
>
> This indeed seems to have changed in Xerces v1.5.1. I was able to
> successfully use same instance of parser, even after generating
> exceptions.
>
> I would invite comments from someone from Xerces development ( apache.org
> or ibm.com ) to autheticate our findings.
>
> --
> With best regards,
>
> Shirish
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org