Use of DOMInputSource causes null entries in 
XSNamespaceItem.getDocumentLocations().
------------------------------------------------------------------------------------

                 Key: XERCESJ-1211
                 URL: http://issues.apache.org/jira/browse/XERCESJ-1211
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema API
    Affects Versions: 2.8.1
         Environment: Linux.
            Reporter: Chris Simmons
            Priority: Minor


I've written a test which I will shortly attach where I load a schema grammar 
using DOMInputSource.  The resulting schema grammar's document locations list 
contains a null entry.

I think this is due to the different code path followed when using dom inputs.  
The normal path loads the schema from a stream and hits the following code in 
XSDHandler.getSchemaDocument():-

                // now we need to store the mapping information from system id
                // to the document. also from the document to the system id.
                if (key != null)
                    fTraversed.put(key, schemaElement );
                if (schemaId != null)
                    fDoc2SystemId.put(schemaElement, schemaId );
                fLastSchemaWasDuplicate = false;
                return schemaElement;

The document isn't being put in fDoc2SystemId when using DOMInputSource.  
Perhaps it would be more robust if XSDHandler was responsible for dealing with 
dom inputs, and just directly used the dom when it normally parses the XML?

I need the document locations field in order to figure out which documents a 
schema grammar depends upon, in case some are modified or reloaded.

-- 
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]

Reply via email to