>Am I missing something here? If the document has no
> DOCTYPE declaration there's no DTD to load.

Before using the XMLReader, I set my own
EntitResolver2 implementation as the XMLReader's
entityResolver. On running in a debugger, For
documents that *do* bear a DOCTYPE declaration, I see
the following method on my entityResolver getting
invoked:
public InputSource resolveEntity( String name, String
publicId, String baseURI, String systemId )

This method is getting invoked only *once* when the
first document is encountered. It is not invoked for
any future documents, so I can see that the caching
works. (If I don't configure the parser with a grammar
pool, this method is called over and over for each new
XML document).

For documents that don't have a DOCTYPE, the following
entityResolver method is called: 
public InputSource getExternalSubset( String name,
String baseURI )

This gets called over and over, despite a matching
grammar being found in the pool. I know that because I
pre-populate the pool with a grammar that has an empty
XMLGrammarDescription ("::::"). Breakpointing on
XMLGrammarPoolImpl.getGrammar(XMLGrammarDescription
desc) shows this grammar being returned for documents
without DOCTYPE...and yet, I see the DTD being
scanned.

Does this make sense? I'd be happy to provide any more
information.

Thanks for your responses.
-Raj


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to