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

Re: Meaning of "enumeration" and "pattern" in xs:list

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 30 May 2003 09:27:21 +0100
Message-ID: <0662436553.20030530092721@jenitennison.com>
To: "Wiedmann, Jochen" <jochen.wiedmann@softwareag.com>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hi Jochen,

> I apologize if the question is stupid, but I am unable to read the
> answer out of the schema specification:
>
> What is the precise meaning of the "enumeration" and "pattern"
> facets, when used in an xs:list type?
>
> Are they constraining the entire list or the items only?

They constrain the entire list: if you want to constrain the items
then you need to restrict the item type definition.

> For example, if I have the following type:
>
>     <xs:simpleType>
>       <xs:list itemType="int"/>
>     </xs:simpleType>
>
> Would
>
>       <xs:enumeration value="1 2 3"/>
>
> be a valid constraint? And if so, would "1 3 2" be a valid value or
> not?

Yes, both would be valid constraints.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 30 May 2003 04:27:32 GMT

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