Re: union of a union legal?

Thanks so much for the help Ashok.  I did see that sentence and had a hard time reconciling it with the one from the spec in my original email.

2.5.1.3 Union datatypes
"Any number (greater than 1) of ·atomic· or ·list· ·datatype·s can participate in a ·union· type"

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."

The latter clearly states (as I read it) the union of union is possible.  The former seems to indicate it is not possible (but does not explicitly state it is not possible).  Given the conflict, I went with the latter which seemed to me to be more specific.

I am still not clear on which sentence to believe.
My apologies for belaboring the point.

Paul








  ----- Original Message ----- 
  From: Ashok Malhotra 
  To: Paul Kiel ; xmlschema-dev@w3.org 
  Sent: Thursday, January 31, 2002 11:14 AM
  Subject: RE: union of a union legal?


  The XML Schema datatypes spec does say in 2.5.1.3 that:

  Any number (greater than 1) of ·atomic· or ·list· ·datatype·s can participate in a ·union· type. 

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

  All the best, Ashok 
  =========================================================== 
  Ashok Malhotra              <mailto: ashokma@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>


   <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 12:16:21 UTC