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

Type derivation problem

From: Guillaume Rousse <rousse@ccr.jussieu.fr>
Date: Fri, 24 Aug 2001 12:09:29 +0200
To: xmlschema-dev@w3.org
Message-Id: <20010824100930.1C1FB2C77@silbermann.snv.jussieu.fr>
I would like to derive a basic type by extension , allowing to add other 
elements and attributes, while restraining some inherited elements allowed 
values. In classical OO language, i would just override get/set methods, but 
is it legal using XML schema ?

I have such a basic Event type, whose date is any year and non mandatory:
<complexType name="EventType" abstract="true">
    <element name="year" type="gYear" minOccurs="0" maxOccurs="1"/>

And such a NameCreation type, whose date is any year>1758, mandatory:
<complexType name="NameCreationType">
    <extension base="model:EventType">
        <element name="foo" type="bar" minOccurs="1" maxOccurs="1"/>
        <element name="year" minOccurs="1" maxOccurs="1">
            <restriction base="gYear">
              <minInclusive value="1758"/>

Guillaume Rousse <rousse@ccr.jussieu.fr>
GPG key http://bohm.snv.jussieu.fr/~rousse/gpgkey.html
Received on Friday, 24 August 2001 06:10:37 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC