RE: Handling the enumeration facet

I think the value given in the value attribute of xs:enumeration is treated
as if it were an instance of the relevant data type appearing in an instance
document. That means, in this case, that 10 is treated as an xs:integer,
because that's the first thing in the list of member types that it matches.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Klaas Dellschaft
> Sent: 29 December 2004 18:33
> To: xmlschema-dev@w3.org
> Subject: Handling the enumeration facet
> 
> 
> Hi,
> 
> in "XML Schema Part 2: Datatypes" it is said that an 
> enumeration constrains 
> the value space to a specified set of values. The information 
> item contains 
> a set of values from the value space. This is an important 
> difference to the 
> pattern facet which constrains the lexical space (and hence 
> only indirectly 
> the value space).
> 
> 
> But the problem is that the schema component of an 
> enumeration facet can 
> only contain the literal of a value. This problem becomes 
> obvious if the 
> value space of a union type is constrained by an enumeration. 
> Given the 
> following type:
> 
> <xs:simpleType>
>     <xs:restriction>
>         <xs:union memberTypes="xs:integer xs:string"/>
>         <xs:enumeration value="10"/>
>     </xs:restriction>
> </xs:simpleType>
> 
> 
> Is the literal "10" only mapped to the number 10 or also to 
> the string "10"? 
> I couldn't find a corresponding section in the specs that 
> unambigously 
> handle this case. Do you know any sections that could help me 
> to solve this 
> problem? How would you translate the literal into its value?
> 
> 
> Thanks in advance
> Klaas 
> 
> 
> 

Received on Thursday, 30 December 2004 18:52:39 UTC