W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2003

over-riding parts of type definitions in XML schema

From: by way of <erik@gaffle.com>
Date: Wed, 08 Jan 2003 06:27:19 -0700
Message-Id: <>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>

I want to suggest an addition to the current specification, to make it
easier to create XML derived representations of types in schemata, to wit,
by over-riding selected parts of an existing type definition.

An example will make clearer the issue I'm addressing.

Say one has the following type definition:

   <xs:complexType name="imageType">
     <xs:attribute name="src" type="xs:string" use="required"/>
     <xs:attribute name="height" type="xs:string"/>
     <xs:attribute name="width" type="xs:string"/>

and one wants to create a type that is an obvious child of it, say a
thumbnail type with a fixed height and width.  As things now stand, I
believe ones options are either (1) to define a wholly new type, with
identical parts except for the 'height' and 'width' attributes which one
defines with fixed values, or else (2) to define imageType without those
two attributes, and then every time one defines an element to be of
imageType, explicitly extend the type to include those two attributes.

It would seem to be easier if one were able to do something like the
following, given the above definition of imageType:

   <xs:complexType name="thumbnailType">
       <xs:override base="imageType">
         <xs:attribute name="height" type="xs:string" fixed="100"/>
         <xs:attribute name="width" type="xs:string" fixed="80"/>

Thank you for your consideration.

Erik Curiel
Received on Wednesday, 8 January 2003 08:31:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:59 UTC