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

RE: union of a union legal?

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Thu, 31 Jan 2002 08:14:35 -0800
Message-ID: <E5B814702B65CB4DA51644580E4853FB019EE824@red-msg-12.redmond.corp.microsoft.com>
To: "Paul Kiel" <paul@xmlhelpline.com>, <xmlschema-dev@w3.org>
The XML Schema datatypes spec does say in that:

Any number (greater than 1) of *atomic*
<http://www.w3.org/TR/xmlschema-2/#dt-atomic#dt-atomic>  or *list*
<http://www.w3.org/TR/xmlschema-2/#dt-list#dt-list>  *datatype*
<http://www.w3.org/TR/xmlschema-2/#dt-datatype#dt-datatype> s can
participate in a *union*
<http://www.w3.org/TR/xmlschema-2/#dt-union#dt-union>  type. 

Note, atomic or list datatypes, not atomic, list or union datatypes.

All the best, Ashok 
Ashok Malhotra              <mailto: ashokma@microsoft.com
<mailto:%20ashokma@microsoft.com> > 
Microsoft Corporation 
212 Hessian Hills Road 
Croton-On-Hudson, NY 10520 USA 
Redmond: 425-703-9462                New York: 914-271-6477 


-----Original Message-----
From: Paul Kiel [mailto:paul@xmlhelpline.com] 
Sent: Thursday, January 31, 2002 7:38 AM
To: xmlschema-dev@w3.org
Subject: 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 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*

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 11:15:12 UTC

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