You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Simon Tyler <Si...@monitrax.com> on 2001/03/01 18:36:35 UTC

Deferred DOM Question

Hi,

I am using Xerces 1.2.3 and I have a query about the defered DOM
implementation. When I create a DOMParser and parse my input only the
top level is done. Later the rest is done on demand. This is fine. 

However, at what point has the DOMParser I created for the initial parse
been finished with? I would like to re-use it if possible to parse some
more XML from a different source but I can't find any documentation
anywhere that tells me when the original parser has finished.

For example, is the following safe:

DOMParser parser = new DOMParser();

parser.parse(xmlinputsource1);
Document doc1 = parser.getDocument();	

parser.reset();

parser.parse(xmlinputsource2);
Document doc2 = parser.getDocument();	

// Do stuff with doc1 and doc2

Simon