Enumeration-facet of union-types

Hi,

I have a question about enumeration facets of union types. I have the
following schema:


----------------------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified">

 <xs:element name="test" type="st.unionType"/>


 <xs:simpleType name="st.unionType">
  <xs:restriction>
   <xs:simpleType>
    <xs:union memberTypes="xs:string xs:integer"/>
   </xs:simpleType>
   <xs:enumeration value="11"/>
  </xs:restriction>
 </xs:simpleType>

</xs:schema>
----------------------------------


In section 2.5.1.3 of "XML Schema Part2: Datatypes" 
(http://www.w3.org/TR/xmlschema-2/#union-datatypes) it is said that the 
evaluation order of datatypes can be overridden with the use of xsi:type.

So my question is whether the value space of "st.unionType" only contains 
the String "11" or also the Integer "11". An example for the problem would 
be the following xml file:


----------------------------------
<test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xsi:noNamespaceSchemaLocation="test.xsd" xsi:type="xs:integer">
   11
</test>
----------------------------------


Is this file valid or should it be rejected? My problem is that I have two 
tools which interpret the enumeration-facet of union types in different ways 
and now I have to decide where to report the bug ;-)

Thanks for your help
Klaas Dellschaft

Received on Wednesday, 24 November 2004 13:12:46 UTC