W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: Inheritance

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 22 Oct 2001 16:49:40 +0100
Message-ID: <41177070894.20011022164940@jenitennison.com>
To: ht@cogsci.ed.ac.uk ((Henry S. Thompson))
CC: "Tim Galle" <timgalle@cyberdude.com>, xmlschema-dev@w3.org

>> Presumably to fix the required and value constraint properties, you'd
>> need to use the final attribute on the complex type definition itself?
> Yes, but then you couldn't change over1... either.

I was hoping that you'd show us a sneaky way of getting around that :)
What about using groups and attribute groups:

 <xs:complexType name="struct1" final="#all">
  <xs:group ref="struct1-content" />
  <xs:attribute name="final1" type="my:ft1"/>
  <xs:attribute name="final2" type="my:ft2"/>
  <xs:attribute name="final3" type="my:ft3"/>
  <xs:attributeGroup ref="struct1-attrs" />

 <xs:group name="struct1-content">
 <xs:attributeGroup name="struct1-attrs">
  <xs:attribute name="over1" type="xs:decimal"/>
  <xs:attribute name="over2" type="xs:string"/>

Redefining the struct1-content group (using xs:redefine) would allow
people to change the content, and redefining the struct1-attrs
attribute group would allow people to change the over1/over2
attributes (or add new ones), but the final1-3 attributes wouldn't be
redefinable... that's if I'm correct that it's not possible to
redefine final complex types using xs:redefine?


Jeni Tennison
Received on Monday, 22 October 2001 11:51:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:54 UTC