Re: Derivation by restriction

Jane Hunter <jane@dstc.edu.au> writes:

> 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..?

The latter, because the interpretation of the XML representation of a
restriction is specified wrt the base type definition, not the base
type definition's XML representation, and _that_ type definition
already has a complete content model, set of attribute use pairs, etc.

> 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>

That's a bug, you're right, sorry!

> 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> 

That's correct.

> 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?

Those are actually the same thing, as I explained above.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 4 January 2001 10:07:05 UTC