Octavian Nadolu created XERCESJ-1613:
----------------------------------------

             Summary: Import with namespace is not resolved corectly 
                 Key: XERCESJ-1613
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1613
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema 1.1 Structures
    Affects Versions: 2.11.0
            Reporter: Octavian Nadolu


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(n) '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>
---------------------------------------------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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