Octavian Nadolu created XERCESJ-1627:
----------------------------------------
Summary: Invalid error when referring an attribute from another
namespace in an overridden schema
Key: XERCESJ-1627
URL: https://issues.apache.org/jira/browse/XERCESJ-1627
Project: Xerces2-J
Issue Type: Bug
Components: XML Schema 1.1 Structures
Affects Versions: 2.11.0
Reporter: Octavian Nadolu
If I validate the "override.xsd" schema with Xerces I get an error. It seems
that it cannot resolve the "attr" attribute that is declared in an imported
schema.
I tested on the xml-schema-1.1-dev branch.
---- override.xsd------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:imp="importNs" targetNamespace="mainNs">
<xs:import namespace="importNs" schemaLocation="import.xsd"/>
<xs:override schemaLocation="extended.xsd">
<xs:element name="mainElem">
<xs:complexType>
<xs:attribute ref="imp:attr"/>
</xs:complexType>
</xs:element>
</xs:override>
</xs:schema>
--------------------------------------
----------- extended.xsd ----------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:imp="importNs"
targetNamespace="mainNs">
<xs:element name="mainElem">
<xs:complexType>
<xs:attribute name="myAttr" type="xs:Name"/>
</xs:complexType>
</xs:element>
</xs:schema>
---------------------------------------------
------- import.xsd-----------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="importNs">
<xs:attribute name="attr" type="xs:string"/>
</xs:schema>
--------------------------------------------
-------- Error-------------------------------------------
[Error] :-1:-1: src-resolve.4.2: Error resolving component 'imp:attr'. It was
detected that 'imp:attr' is in namespace 'importNs', but components from this
namespace are not referenceable from schema document 'null'. If this is the
incorrect namespace, perhaps the prefix of 'imp:attr' needs to be changed. If
this is the correct namespace, then an appropriate 'import' tag should be added
to 'null'.
---------------------------------------------------------
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]