You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Andy Clark <an...@apache.org> on 2000/02/01 01:19:18 UTC

Re: InputSource-Implementation

Armin Pfarr wrote:
> I get different results when trying to implement an Entity-resolver
> depending on the construction of an InputSource.

I think the cause of your problem is that the parser, given a URI
that you've created from getClass().getResource(), doesn't know
how to resolve that entity. 

By implementing your own EntityResolver, you are saying that you
are going to supply the way to access the entity. When you create
an InputSource from a URI and hand that back to the parser, now
the parser must be able to resolve that entity just based on the
system URI. The parser doesn't know that it must now ask the class
object to read that resource. Does this make sense?

There is nothing wrong with the second way you have implemented
the EntityResolver. In fact, I would argue that the first way you 
have implemented the resolver is wrong and should never be
expected to work correctly.

> I'm using JDK1.2.2 from SUN under NT and the latest available
> Xerces-Implementation from xml.apache.org/dist.

Please always include the version number of the Xerces impl.
Otherwise there might be ambiguity about what "the latest
available" implementation is.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org