Robert Ritler wrote:
> I use for example parser.parse("MyFile"). The file does not exist, so
> the parser calls my EntityResolver to resolve "MyFile". I guess that's
> not the way it works. Can someone give me a hint on how to achieve
> this?
Even though the parser doesn't call the entity resolver for
the document entity, there's nothing preventing you from
calling it. For example, instead of the following: (I'm
using the SAX XMLReader as an example...)
EntityResolver resolver = /* ... */
XMLReader reader = /* ... */
reader.setEntityResolver(resolver);
String systemId = "MyFile";
reader.parse(systemId);
do the following:
String systemId = "MyFile";
InputSource source = resolver.resolveEntity(null, systemId);
if (source == null) {
source = new InputSource(systemId);
}
reader.parse(source);
--
Andy Clark * [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]