You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jeff Greif <jg...@alumni.princeton.edu> on 2003/03/20 22:58:15 UTC

reusing parsers

In using a org.apache.xerces.parsers.DOMParser, if you have a fixed configuration and feature/property settings, is anything much gained by skipping repeated calls to the constructor, and instead reusing a parser and resetting the state between parses, as opposed to creating a new parser with a shadowed symbol table for each parse, in a situation where a set of grammars will be compiled ahead of time, but others will be encountered with indeterminate frequency and scatter an openended set of possibilities depending upon the user's activities.  Will the inability to reset the symbol table of a reused parser create a justification for using a new parser (with a shadowed symbol table derived from a fixed one) for each parse?

If you decide to reuse a parser, should you call reset between uses?  Will you have to manually reset other things to get back to a repeatable state?

Jeff