Radu Coravu created XERCESJ-1591:
------------------------------------

             Summary: Cannot properly redefine attribute group which is not 
directly in the redefined schema 
                 Key: XERCESJ-1591
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1591
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema 1.0 Datatypes
    Affects Versions: 2.11.0
            Reporter: Radu Coravu
             Fix For: 2.11.0


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

--
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