[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

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 
declaration:

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


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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.