Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.11.0
-
None
Description
This bug is related with: XERCESJ-1584
The samples are these:
1) test.xml
<el xmlns="tns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="tns 3.xsd"/>
2) 3.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="tns" xmlns="tns">
<xs:redefine schemaLocation="2.xsd">
<xs:attributeGroup name="Para.Decorate">
<xs:attributeGroup ref="Para.Decorate"/>
<xs:attribute ref="id" use="required"/>
</xs:attributeGroup>
</xs:redefine>
<xs:attribute name="id"/>
<xs:element name="el" type="ct"/>
</xs:schema>
3) 2.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="tns">
<xs:include schemaLocation="1.xsd"/>
</xs:schema>
4) 1.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="tns" xmlns="tns">
<xs:complexType name="ct">
<xs:attributeGroup ref="Para.Decorate"/>
</xs:complexType>
<xs:attributeGroup name="Para.Decorate"/>
</xs:schema>
When an older version of Xerces is used to validate the XML, it reports one problem on it, that the required "id" attribute is missing.
The Xerces 2.11.0 with XML Schema 1.1 support reports no problem when validating the XML (both in XML Schema 1.1 and 1.0 compatibility mode).
I think that a similar fix like in XERCESJ-1584 should be also made in the class:
org.apache.xerces.impl.xs.traversers.XSDAttributeGroupTraverser