Am not sure if there's a way to keep a in-memory representation of the DTD so that can be reused.
Check out the interface
org.xml.sax.EntityResolver
You can give an implemenetaion for this interface and return any kind of inputsource.
Again i need to confirm if it will get called when the parser hits a <!DOCTYPE declaration.
Please let us know in case you find a solution for your problem.
Originally posted by Edy Yu:
I am valdating XML documents against an external dtd.
My question is if I reuse the Parser instance for the second XML document after parsing/validating the first one, will the parser read from the external dtd file again? It apears so from the hsystem I/O report. Is there a way to let the parser reuse a loaded dtd? By the way, those XML documents use the same DTD.
Thanks in advance.