union of a union legal?

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>

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


My first inclination was yes, based on this sentence from the schema spec:

4.1.2.3 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
919-846-0224
paul@hr-xml.org

Received on Thursday, 31 January 2002 10:37:00 UTC