W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

Derivation by restriction

From: Jane Hunter <jane@dstc.edu.au>
Date: Mon, 18 Dec 2000 15:08:51 +1000
Message-Id: <200012180508.eBI58UH05870@piglet.dstc.edu.au>
To: www-xml-schema-comments@w3.org
The MPEG-7 group requires clarification wrt derivation by restriction 
on a base type which was itself derived by extension.

When specifying the restriction do you only have to repeat the 
components of the immediate base type or do you have to also repeat all 
of the content model components of the super-type hierarchy inherited 
by the base type i.e. the base of the base of the base..? This is not 
clear because of an inconsistency between an example in section 4.3.2 
and the schema for the schema for Part 2.

In the second example in section 4.3.2, xs:facet is defined as an 
extension of xs:annotated and xs:encoding and xs:period are 
restrictions of xs:facet. Only the extended components are repeated in 
the restriction definitions.
<xs:complexType name="facet">
       <xs:extension base="xs:annotated">
           <xs:attribute name="value" use="required"/>

<xs:element name="encoding" substitutionGroup="xs:facet">
            <xs:restriction base="xs:facet">
               <xs:attribute name="value" type="xs:encodings"/>

However in the schema of the schema for Part 2, the content model of 
the super-super-type is present:

<element name="encoding" id="encoding" substitutionGroup="facet">
            <restriction base="facet">
<!-- here's the content model from annotated -->
                    <element ref="annotation" minOccurs="0"/>

                <attribute name="value">

Could someone please clarify whether you need to repeat the content 
model of the entire type hierarchy or only that of the immediate 
basetype when specifying a derivation by restriction?

| Jane Hunter                 | Senior Research Scientist           |
| DSTC Pty Ltd                | Distributed Systems Technology CRC  |
| Level 7, GP South           | Tel   : +61 7 3365 4310             |
| University of Queensland    | Fax   : +61 7 3365 4311             |
| Queensland 4072, Australia  | Email : jane@dstc.edu.au            |
Received on Monday, 18 December 2000 00:08:58 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:54 UTC