Entity resolver returning DOMInputSource causes base URI to be lost
-------------------------------------------------------------------
Key: XERCESJ-1183
URL: http://issues.apache.org/jira/browse/XERCESJ-1183
Project: Xerces2-J
Issue Type: Bug
Components: XNI
Affects Versions: 2.8.0
Environment: Sun JDK 1.5 for Linux/AMD64
Reporter: Bas de Bakker
I'm trying to preparse an XML Schema (let us call it schema1) that includes
schema2, which again includes schema3. These are specified in the including
schemas using a relative path. I have schema2 and schema3 available as a DOM
tree from a non-Xerces DOM implementation. To avoid serializing and reparsing
them, I'm trying to return a DOMInputSource from my implementation of
XMLEntityResolver.resolveEntity().
While schema2 is found correctly, my application cannot find schema3. The
reason is that the resourceIdentifier passed to resolveEntity() does not
contain a baseSystemId, unlike the one passed when looking up schema2.
I have traced this behaviour to the doc2systemId() method in
org.apache.xerces.impl.xs.traversers.XSDHandler. If I remove the instanceof
check and unconditionally call getDocumentURI() on the element supplied by my
entity resolver, my application works correctly.
Alternatively, I would expect Xerces to construct a baseSystemId to be used for
schema3 from the baseSystemId and the systemId that I set on the DOMInputSource
that I create for schema2. Apparently it does do so if instead of the
DOMInputSource I return an XMLInputSource for schema2 (using a StringReader on
the serialized representation of schema2).
--
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]