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:complexContent>
       <xs:extension base="xs:annotated">
           <xs:attribute name="value" use="required"/>
       </xs:extension>
   </xs:complexContent>
</xs:complexType>

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

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">
    <complexType>
        <complexContent>
            <restriction base="facet">
<!-- here's the content model from annotated -->
                <sequence>
                    <element ref="annotation" minOccurs="0"/>
                </sequence>

                <attribute name="value">
                 ...
                </attribute>
            </restriction>
        </complexContent>
     </complexType>
</element> 

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?

thanks,
jane
+-----------------------------+-------------------------------------+
| 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT