W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2003

Re: Enumeration component and restriction

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: Wed, 27 Aug 2003 14:14:56 +0100
To: "Michael Marchegay" <mmarcheg@optonline.net>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bvfsj1bu7.fsf@erasmus.inf.ed.ac.uk>

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

> 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 09:14:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:39 GMT