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, 02 Nov 2009 15:10:17 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1N4yXx-0008CM-8t@wiggum.w3.org>

--- Comment #3 from Kevin Braun <kbraun@obj-sys.com>  2009-11-02 15:10:16 ---
Yes, it really is a usability issue and not a logical inconsistency.  I
understand the point about its relative impact versus getting 1.1 out.

However, it does seem to me rather unfortunate if this feature goes out as-is. 
Assume that I want every complex type to have the default attributes.  The
intent seems to be that I would then just specify defaultAttributes="XYZ" on
the schema.  However, in reality, since defaultAttributesApply="true" is the
default for all complex types, I must additionally specify
defaultAttributesApply="false" for all types that extend a complex type. 
Otherwise, I'll get errors for duplicate attributes.  So, the feature doesn't
seem to quite work the intended magic, which I think is unfortunate.

I think something along the following lines would be closer to having the
intended effect.  Let defaultAttributesApply be a property of the ComplexType
component, set in the following way:
   if the "defaultAttributesApply" attribute is present: the specified value
   else if complex type with implicit content: true
   else if derivation method = restriction:  false
   else if derivation method = extension
      if the base type is a simple type : true
      else if the base type is a complex type: false

There might still be some oddball cases, but I think this would let a user
specify "defaultAttributes" on the schema and get every complex type having the
default attributes without having to do anything extra.

I would think if you include this feature in 1.1, you want it to work as
intended and that if it doesn't work as intended now, it won't be easy to
change later.  If you agree that it doesn't quite achieve what you wanted, you
might not want to put it in at all, or else fix it?

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, 2 November 2009 15:10:18 UTC

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