W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2009

[Bug 8119] defaultAttributes and complexType extension/restriction don't play nice

From: <bugzilla@wiggum.w3.org>
Date: Mon, 09 Nov 2009 20:27:30 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1N7apm-00085h-NX@wiggum.w3.org>

--- Comment #5 from Kevin Braun <kbraun@obj-sys.com>  2009-11-09 20:27:30 ---
> In the example in comment #0, there is a single attribute group definition
> component, with a single attribute use component in its {attribute uses}
> property...

> ...there is a *single* attribute use component, the union should *not* result 
> in 2 entries in "TypeB"'s {attribute uses}, and the relevant constraint 
> (clause 4 of section is *not* violated.

> ... These 2 cases are different. 2 references to the same attribute group
> component result in a single attribute use; 2 locally declared attributes
> result in 2 distinct attribute use components.

Good point.  I missed this.

As a side note, here is a schema that would present the same case, I think. 
XSV and Xerces both report errors on it:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xs:attributeGroup name="AttrGroup">
      <xs:attribute name="a_default" type="xs:string"/>

   <xs:complexType name="TypeA">
      <xs:attributeGroup ref="AttrGroup"/>

   <xs:complexType name="TypeB">
         <xs:extension base="TypeA">
            <xs:attributeGroup ref="AttrGroup"/>

XSV reports: 11:4: Invalid: attempt to extend with an attribute already
declared {{None}:a_default}
Xerces reports: [14,49]: ct-props-correct.4: Error for type 'TypeB'. Duplicate
attribute uses with the same name and target namespace are specified.  Name of
duplicate attribute use is 'a_default'.

Based on the above, I assume these implementations are incorrect; there is only
a single attribute use component involved.

Given the above, some of what I said would no longer be an issue.  You would
still have some cases of restriction where a default of
defaultAttributesApply="false" would be preferable, but it becomes less of an

Other than perhaps adopting Sandy's suggested revision of clause 4 of section, I think this can be closed.  Sorry for taking your time.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Monday, 9 November 2009 20:27:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:10 UTC