- From: Michael Marchegay <mmarcheg@optonline.net>
- Date: Wed, 27 Aug 2003 16:00:54 +0200
- To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
- Cc: <xmlschema-dev@w3.org>
----- Original Message ----- From: "Henry S. Thompson" <ht@cogsci.ed.ac.uk> To: "Michael Marchegay" <mmarcheg@optonline.net> Cc: <xmlschema-dev@w3.org> Sent: Wednesday, August 27, 2003 15:14 Subject: Re: Enumeration component and restriction > "Michael Marchegay" <mmarcheg@optonline.net> writes: > > > I would like to have a clarification on the way to build the {value} > > property of an enumeration component, and especially how those values are > > conveyed accross restrictions. > > > > For example, if a type (call it A) restricts a buil-in type by using several > > <enumeration> information item in the XML representation, and if another > > type (call it B) restricts A by specifying some of the <enumeration> > > information item specified in A, what components are in the {facets} of A, > > and what is its (their) value(s)? > > The set of all the [schema normalized value]s of the 'value' > attributes of the <enumeration> children in the definition of B. > > > Example: > > --- > > <xs:simpleType name="A"> > > <xs:restriction base="xs:token"> > > <xs:enumeration value="x"/> > > <xs:enumeration value="y"/> > > <xs:enumeration value="z"/> > > </xs:restriction> > > </xs:simpleType> > > > > <xs:simpleType name="B"> > > <xs:restriction base="A"> > > <xs:enumeration value="y"/> > > </xs:restriction> > > </xs:simpleType> > > --- > > > > Does the {facets} property of B contain: > > 1 - One enumeration component whose {value} is {y}? > > 2 - One enumeration component whose {value} is {x, y, z}? > > 3 - Two enumeration components whose {value}s are {y} and {x, y, z}? > > > > XML Schema part. 2 - 4.3.5.3 makes me think that 3 would be the correct > > answer... > > This section reads: > > "If multiple <enumeration> element information items appear as > [children] of a <simpleType> the {value} of the enumeration > component should be the set of all such [value]s." > > I read that as saying the answer is (1), i.e. {y}. How can you read > it otherwise? The definition of the {facets} property is: --- {facets} A set of facet components ·constituting a restriction· of the {facets} of the {base type definition} with respect to a set of facet components corresponding to the appropriate element information items among the [children] of <restriction> (i.e. those which specify facets, if any), as defined in Simple Type Restriction (Facets) (§3.14.3). --- It says that Schema Representation Constraint: Simple Type Restriction (Facets) shall by used for determining the {facets] property. --- Schema Representation Constraint: Simple Type Restriction (Facets) For a simple type definition (call it R) to restrict another simple type definition (call it B) with a set of facets (call this S) all of the following must be true: [...] 3 The {facets} of R are the union of S and the {facets} of B, eliminating duplicates. To eliminate duplicates, when a facet of the same kind occurs in both S and the {facets} of B, the one in the {facets} of B is not included, with the exception of enumeration and pattern facets, for which multiple occurrences with distinct values are allowed. --- 3) uses the {facets} property of the base type definition, and says that multiple occurence of a enumeration (I understand it as enumeration schema component) are allowed with distinct values. I deduce from it that a simple type definition can contain several enumeration components in its {facets} property, and that the facets of the enumeration component of the base type is added to the {facets} of the derived type regardless of the presence of an enumeration component (built from "local" <enumeration> information items, as described in 4.3.5.3). I understand the last part of the last sentence as allowing multiple enumeration *components*. But it seems that in fact, it says that multiple <enumeration> information items are allowed; those will be used for building *one* enumeration component, that behaves just like other facet components (it is overriden by the one defined locally within a restriction step). Michael > > > And what for the following type? > > > > <xs:simpleType name="C"> > > <xs:restriction base="A"/> > > </xs:simpleType> > > > > Would it be one enumeration component with a {value} being {x, y, z}? > > Yes. > > ht > -- > Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh > Half-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/ > [mail really from me _always_ has this .sig -- mail without it is forged spam] >
Received on Wednesday, 27 August 2003 10:00:57 UTC