[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-xml] Inconsistency in EntityResolvers?

From: David Brownell
Subject: Re: [Classpathx-xml] Inconsistency in EntityResolvers?
Date: Sun, 07 Apr 2002 10:20:18 -0700

> When not validating and using EntityResolver I got that missing-protocol 
> exception about which I wrote back then. It was solved by setting a kind of 
> root URL for the main document. 

> However, someone pointed to me to a workaround that used EntityResolver2
> instead... It seems that this resolver does not expand (or absolutize the URL)
> befour trying to validate, as EntityResolver itself does, even without 
> validation.

Right, parsers pass the base and relative URIs to the implementation
of EntityResolver2, rather than resolving them first.  Only if that returns
null will the parser absolutize that URI before dereferencing it.

Validation has nothing to do with entity resolution, except that you can
never turn off use of external entities when you're resolving.

>     Thus, the two classes do not behave consistently for the same XML 
> document. Is this intentionally? If so, why the difference? 

To support richer models of entity resolution than the original SAX1
API, including ones where the entity resolver implements new URI
schemes that the underlying JVM scheme doesn't support.

It's a new API, so of course it doesn't behave the same as the old
one.  In the way you're using "consistent", new API features could
never be added without major incompatible revisions!

>    And why does 
> EntityResolver tries to sanitize the SYSTEM id in the DOCTYPE line even when 
> it does not validate anyway?

Validation has nothing to do with entity resolution, as explained above.

- Dave

reply via email to

[Prev in Thread] Current Thread [Next in Thread]