You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2005/10/06 06:19:48 UTC

[jira] Commented: (XERCESJ-1104) Resolution of schemaLocation URIs should be via URI resolution, not entity resolution

    [ http://issues.apache.org/jira/browse/XERCESJ-1104?page=comments#action_12331458 ] 

Michael Glavassevich commented on XERCESJ-1104:
-----------------------------------------------

What you're describing is the behaviour of one implementation of XMLEntityResolver, specifically the SAX EntityResolverWrapper which bridges between XNI and a SAX EntityResolver. I agree that schema locations are not system identifiers however there's no way to differentiate them with SAX so they're reported as system ids. This is a limitation of SAX. EntityResolver was not designed for resolving schema documents but it's the only interface available to SAX users, so we have to use what's there regardless of whether it's semantically wrong.

XMLEntityResolver is an interface. There's nothing restricting its behaviour in the way you describe. If you register your own implementation of XMLEntityResolver with the parser you can map the XMLResourceIdentifier (which has many fields including the target namespace if the resource is a schema document) [1] passed to resolveEntity in any way you feel like to a catalog.  If the resource being resolved is a schema document then the XMLResourceIdentifier will be an instance of XMLSchemaDescription [2][3] which contains even more information like a complete list of location hints. There's no need for another type of resolver.  The current interfaces already support what you need.

[1] http://xml.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/XMLResourceIdentifier.html
[2] http://xml.apache.org/xerces2-j/faq-write.html#faq-5
[3] http://xml.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/grammars/XMLSchemaDescription.html

> Resolution of schemaLocation URIs should be via URI resolution, not entity resolution
> -------------------------------------------------------------------------------------
>
>          Key: XERCESJ-1104
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1104
>      Project: Xerces2-J
>         Type: Bug
>   Components: XNI
>     Versions: 2.6.0, 2.7.1
>  Environment: All
>     Reporter: William Eliot Kimber

>
> The resolveSchema() method of XSDHandler uses the entityResolver to resolve URIs in schema location hints. This has the effect that, when using a catalog resolver that SYSTEM entries are used to resolve the schema URIs.
> However, schemas are not entities and therefore their URI references should not be resolved via an entity resolver but via a URI resolver and should, therefore be resolved via URI catalog entries, not SYSTEM entries.
> That is, by the OASIS Entity Resolution spec one would expect to declare URI entries to remap schema location URIs but this does not work. 
> I'm happy to develop a fix but it may take me a while to figure out exactly how to go about it. 
> Because this behavior has been around for a while (since at least version 2.6) and is documented in at least one tutorial I found, it will probably be necessary to control the use of an entityResolver or URI resolver through a system property.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org