Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » enumeration-facet of union types
enumeration-facet of union types [message #592576] Tue, 23 November 2004 12:29
Klaas Dellschaft is currently offline Klaas DellschaftFriend
Messages: 58
Registered: July 2009

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

<xs:schema xmlns:xs=""

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

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


I had a look into the implementation of the type system in XSD. I've seen
that xs:string is represented by the Java String-type and xs:integer is
represented by BigDecimal.

So the value space of the anonymous sub union-type would contain String and
BigDecimal values. If I restrict this type with the enumeration facet I'm
not sure whether the value space of "st.unionType" would contain
String("11") and BigDecimal("11") or only String("11").

In the datatypes part of the W3C it is said that a lexical value is
validated against the memberTypes until a match is found but the evaluation
order can be overridden with the use of xsi:type.

So from my point of view it should be possible to validate the following
file against the schema from above:

<test xmlns:xsi=""
xsi:noNamespaceSchemaLocation="test.xsd" xsi:type="xs:integer">

And Xerces-C also successfully validates this file. So I think the value
space of "st.unionType" should contain BigDecimal("11") and String("11).

But at the moment if I call the function XSDEnumerationFacet.getValue() on
the enumeration facet of "st.unionType" I only get one Object, the
String("11") and not also BigDecimal("11"). I would interpret this result
that XSD only puts String("11") into the value space of "st.unionType" and
not also BigDecimal("11"). Is this correct (my interpretation and/or the
behaviour of XSD)?

Klaas Dellschaft
Previous Topic:Analysing Complex Types derived by extension
Next Topic:Using XSD API with DOM
Goto Forum:

Current Time: Thu May 24 06:34:37 GMT 2018

Powered by FUDForum. Page generated in 0.01308 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top