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

Import with namespace is not resolved corectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.11.0
    • None
    • None

    Description

      I have a "master.xsd" schema which imports with namespace "importedSchema.xsd" schema. Then the "importedSchema.xsd" includes a "includedSchema.xsd" schema. The import with namespace is resolved through catalog, for this I have a "catalog.xml".
      If I validate the "master.xsd" schema an error is displayed:
      src-resolve: Cannot resolve the name 'is:failureType' to a 'type definition' component

      The type is defined in the included schema "includedSchema.xsd" and can be referred from the "master.xsd" schema. So there should be no error reported.
      You can reproduce the issue on the xml-schema-1.1-dev branch with the XML Schema 1.1 enabled.

      ------------------master.xsd--------------------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:is="imported:schema">
      <xs:import namespace="imported:schema"/>
      <xs:element name="elem" type="is:failureType"/>
      </xs:schema>
      -----------------------------------------------------------------

      ---------------- importedSchema.xsd ---------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="imported:schema">
      <xs:include schemaLocation="includedSchema.xsd"/>
      </xs:schema>
      -----------------------------------------------------------------

      ------------------ includedSchema.xsd-----------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:simpleType name="failureType">
      <xs:restriction base="xs:integer">
      <xs:maxExclusive value="100"/>
      <xs:minExclusive value="0"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:schema>
      --------------------------------------------------------------------

      --------------------catalog.xml------------------------------------
      <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
      <uri name="imported:schema" uri="importedSchema.xsd"/>
      </catalog>
      ---------------------------------------------------------------------------

      Attachments

        Activity

          People

            Unassigned Unassigned
            octavian.nadolu Octavian Nadolu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: