You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org> on 2013/06/12 10:08:20 UTC

[jira] [Commented] (XERCESJ-1615) Error not reported on duplicate attributes

    [ https://issues.apache.org/jira/browse/XERCESJ-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13681027#comment-13681027 ] 

Mukul Gandhi commented on XERCESJ-1615:
---------------------------------------

I've done some study on this issue, and I don't think its a bug. Here are the relevant sections from the XML Schema 1.1 Structures spec,

3.6 Attribute Group Definitions
  3.6.3 Constraints on XML Representations of Attribute Group Definitions
  Schema Representation Constraint: Attribute Group Definition Representation OK
    None as such.

  3.6.6 Constraints on Attribute Group Definition Schema Components
    2 No two distinct members of the {attribute uses} have {attribute declaration}s with the same expanded name.

We conform to both of these points. 3.6.3 doesn't require any implementation. 3.6.6 (2) requires an implementation, but it asks for an Attribute Group component to comply and not its XML representation. When I inspect the grammar object built upon successful parse of the schema document illustrated, I can see only one XSAttributeDecl object associated with the complex type definition component. It seems, Xerces is doing a deduplication of members of the {attribute uses} having the same expanded name (therefore it implements 3.6.6 (2) fine).
                
> Error not reported on duplicate attributes
> ------------------------------------------
>
>                 Key: XERCESJ-1615
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1615
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures, XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Octavian Nadolu
>
> If I validate the following schema Xerces does not complain about the the duplicate attribute. The same attribute group is referred twice.
> You can reproduce the issue on the xml-schema-1.1-dev branch.
> -------- schema.xsd --------------------
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
>     <xs:complexType name="baseType">
>         <xs:attributeGroup ref="globalAttributes"/>
>         <xs:attributeGroup ref="globalAttributes"/>
>     </xs:complexType>
>     
>     <xs:attributeGroup name="globalAttributes">
>         <xs:attribute name="id" type="xs:ID"/>
>     </xs:attributeGroup>
> </xs:schema>
> -------------------------------------------------------

--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org