- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Fri, 16 Nov 2001 09:25:15 +0000
- To: Ross Thompson <rthompson@contivo.com>
- CC: xmlschema-dev@w3.org, KAZUMI Saito <ksaito@jp.fujitsu.com>
Hi Ross, >> 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. > > This is confusing at best, and wrong in my view. From part 2, > section 4.1.2: > > A derived datatype can be derived from a primitive datatype or > another derived datatype by one of three means: by restriction, by > list or by union. > > The base type of lists and unions, as you imply, is anySimpleType, > but that is not the type from which they derive. Yes, you're right. As I said later in the message, it's easy to get confused in this area because the two parts say very different things. I based the above description on the XML Schema Structures document, which I was wrong to do because it's not normative in this area. (Plus personally I find it confusing that you can have a type that derives from a type that isn't its base type :) So OK, in the example dates was derived from xs:date by list (meaning that xs:date is the item type of dates). And fiveToTenDates was derived from dates by restriction (meaning that dates is the base type of fiveToTenDates). This is still a little confusing when it comes to looking at the role of {final} (the two parts describe it differently and give it different sets of values, Part 1 having more detail but being non-normative). But Section 3.14.6 of Part 1 is normative, so the fact that you can't derive from a list type by restriction if its {final} contains 'list' seems irrefutable (though peculiar, in my view). What doesn't seem to be stated explicitly in the constraints, or at least I couldn't find it (although it's mentioned in the text) is that the {item type definition} of a list type can't have 'list' in its {final} and the {member type definitions} of a union type can't have 'union' in their {final}. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
Received on Friday, 16 November 2001 04:25:23 UTC