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

Enumeration-facet of union-types

From: Klaas Dellschaft <klaasd@uni-koblenz.de>
Date: Tue, 23 Nov 2004 17:39:20 +0100
Message-ID: <007701c4d17a$fb6f30c0$92471a8d@MorningSun>
To: <xmlschema-dev@w3.org>

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

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC