- From: by way of <erik@gaffle.com>
- Date: Wed, 08 Jan 2003 06:27:19 -0700
- 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"/> </xs:complexType> 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:complexContent> <xs:override base="imageType"> <xs:attribute name="height" type="xs:string" fixed="100"/> <xs:attribute name="width" type="xs:string" fixed="80"/> </xs:override> </xs:complexContent> </xs:complexType> Thank you for your consideration. Yours, Erik Curiel
Received on Wednesday, 8 January 2003 08:31:17 UTC