W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2004

Re: Handling the enumeration facet

From: Klaas Dellschaft <klaasd@uni-koblenz.de>
Date: Thu, 30 Dec 2004 22:38:57 +0100
Message-ID: <005001c4eeb7$f92c1c60$c301a8c0@MorningSun>
To: "Michael Kay" <mike@saxonica.com>, <xmlschema-dev@w3.org>

> 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.

But you can change the sequence of evaluation in an instance document with 
the attribute xsi:type. So if we take my previous example and add an element 

<xs:element name="test">
            <xs:union memberTypes="xs:integer xs:string"/>
            <xs:enumeration value="10"/>

What you said would mean that the following should be rejected by a parser:

<test xsi:type="xs:integer">10</test>

I'm asking these questions because I'm using two tools which handle this 
differently and I'm not sure whether the possible change of evaluation order 
should also be reflected by interpreting the literal of an enumeration. This 
would require that the value space does not only contain the number 10 but 
also the string "10". What do you think?

Klaas Dellschaft 
Received on Thursday, 30 December 2004 21:39:04 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:07 UTC