- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Thu, 15 Nov 2001 12:36:24 +0000
- To: KAZUMI Saito <ksaito@jp.fujitsu.com>
- CC: xmlschema-dev@w3.org
Hi, > Likes as "Schema Component Constraint: Simple Type Definition Properties > Correct", the "Schema Component Constraint: Derivation Valid (Restriction, Simple) " > says : > > 2 If the {variety} is list, then all of the following must be true: > 2.3 If the {base type definition} is not the ?simple ur-type definition?, > then all of the following must be true: > 2.3.2 The {final} of the {base type definition} must not contain restriction. > > Then the dates type in your example doesn't have a {final} which > includes the value 'list' or 'restriction'. > > ><xs:simpleType name="dates"> > > <xs:list itemType="xs:date" /> > ></xs:simpleType> > > > ><xs:simpleType name="fiveToTenDates"> > > <xs:restriction base="dates"> > > <xs:minLength value="5" /> > > <xs:maxLength value="10" /> > > </xs:restriction> > ></xs:simpleType> That's right. The above example was valid. The other two examples *did* have a {final} that included the value 'list', so weren't valid. > Such derivation is not only 'derivation by list' but also > 'derivation by restriction' ? Um, well technically simple types are all derived by restriction. If an xs:simpleType element has a xs:restriction element inside, the simple type is derived by restriction from the simple type referred to by the base attribute on that xs:restriction. If the xs:simpleType element has a xs:list or xs:union element inside, then it's derived by restriction from the simple ur-type definition. In the above example, the dates simple type is a list type derived by restriction from the simple ur-type. The fiveToTenDates simple type is a list type derived by restriction from the dates simple type. Actually, this area is a bit difficult to judge because the XML Schemas data types document actually holds the normative description of simple type definitions, which is quite different from what's held in the XML Schema structures document. In the XML Schemas data types document it does talk about derivation by list and union. The XML Schema data types description only has this to say about the effect of {final}: If {final} is the empty set then the type can be used in deriving other types; the explicit values restriction, list and union prevent further derivations by ·restriction·, ·list· and ·union· respectively. Which doesn't really help to identify exactly what impact {final} has on anything, and certainly doesn't go into the same amount of detail as the XML Schema structures document. Note that this also ignores a final containing 'extension', which is counted according to the XML Schema structures document. That probably hasn't helped :( Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
Received on Thursday, 15 November 2001 07:40:57 UTC