W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

union of a union legal?

From: Paul Kiel <paul@xmlhelpline.com>
Date: Thu, 31 Jan 2002 10:38:08 -0500
Message-ID: <178901c1aa6d$489eac00$2cfca218@pkiel2>
To: <xmlschema-dev@w3.org>
In running some schemas through my various array of tools, I came across an issue that needs clarification.  If I defined two simpleTypes that are unions, can I use one as a memberType of the other?  I know a union cannot be in a list, but can a union be in a union?  Here is an example:

 <xsd:simpleType name="OneType">
  <xsd:union memberTypes="Type1 Type2 Type3"/>

 <xsd:simpleType name="OtherType">
  <xsd:union memberTypes="OneType Type4 Type5"/>

My first inclination was yes, based on this sentence from the schema spec: Derivation by union
"A ·union· datatype can be ·derived· from one or more ·atomic·, ·list· or other ·union· datatypes, known as the ·memberTypes· of that ·union· datatype."

I am however getting an error using Topologi (which uses msxml4 under the hood if memory serves) and get the error:

"Union datatypes must be derived from an atomic or list datatype."  

This error made me think that I had read something along those lines before in the spec, but alas I cannot find it.

Many thanks for your comments,
Paul Kiel

W. Paul Kiel
Chief Architect
HR-XML Consortium
Received on Thursday, 31 January 2002 10:37:00 UTC

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