Re: EntityResolver problem with Aelfred parser

David Brownell <[email protected]> Wed, 14 Apr 2004 18:02:09 -0700
Newsgroups gmane.comp.java.classpath.extensions.discuss
Message-ID <[email protected]>
Maarten Coene wrote:
> Hi,
> 
> I have a problem with specifying an EntityResolver with the Aelfred 
> SAXDriver. In some situations, the specified EntityResolver will not be 
> used to resolve the entities. This can happen if you pass an InputSource 
> to the SAXDriver.parse( ... ) method without specifying a systemId.

Passing such an InputSource is a bug in your application level
code.  Provide a base URI, and all SAX parsers should act the
same.  If you don't, there's no way to guess the right value;
and I don't know any "how to guess" convention that can won't
break in some environments.  (For a file, it might be $PWD.
For an HTTP URI, it might be something else entirely ...)
Which is why it doesn't guess, and reports that error.

If you really really want to make it harder to notice that kind
of application bug, don't just hide that guess ... make it an
explicit thing, at least by way of a "here's where we guess"
comment.  A settable parser property for the default value
would is the best option I've heard.

- Dave