Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1211

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.1, 2.9.0, 2.9.1
    • 2.10.0
    • XML Schema API
    • None
    • Linux.

    Description

      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.

      Attachments

        1. NullSchemaLocations.zip
          1 kB
          Chris Simmons

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            cps@decisionsoft.com Chris Simmons
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: