[ http://issues.apache.org/jira/browse/XERCESJ-1104?page=comments#action_12332642 ]
Michael Glavassevich commented on XERCESJ-1104: ----------------------------------------------- The "out of the box" behaviour for XNI attempts to locate schema documents using the target namespace. They are rightfully treated as URI references so resolveURI() is called on the catalog to find a matching URI entry. If there is no matching URI entry in the catalog or the schema has no target namespace then the location hint is treated as an external identifier. This was done for consistency with the SAX behaviour where only the schema location hint is available and is passed to the resolver as the systemId parameter. For a SAX application the only interface available is EntityResolver. If you want to allow these applications to resolve non-entity resources using SAX alone then you have no choice but to use the fields available: systemId or publicId. It's unfortunate that SAX's entity resolver wasn't designed for broader usage but it's all we've got. DOM Level 3 (LSResourceResolver) and StAX (XMLResolver) are a better fit for schema resolution (though they too aren't general enough for resolving other types of resources). An XNI XMLEntityResolver can be set on the parser by calling setProperty() with this property URI: http://apache.org/xml/properties/internal/entity-resolver. Applications which rely on it are obviously limited to using Xerces. > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
