W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2021

Re: union of complex types

From: Mukul Gandhi <mukulg@softwarebytes.org>
Date: Mon, 19 Jul 2021 10:21:06 +0530
Message-ID: <CANGHzgCcFXiLhPih8yyuF+TUw9nTavqrHASddabjtONvVOJ8rQ@mail.gmail.com>
To: xmlschema-dev@w3.org
On Fri, Jul 16, 2021 at 9:29 AM Mukul Gandhi <mukulg@softwarebytes.org>
wrote:

> Hi all,
>     XSD language already provides, for union syntax for the simple types
> as follows,
>
> <!-- here the XSD language already provides, that Type1 and Type2 can only
> be simple types -->
> <xs:simpleType name="ST1">
>     <xs:union memberTypes="Type1 Type2" />
> </xs:simpleType>
>
> I propose, a similar new facility for XSD complex types, as follows,
>
> <!-- Type3 and Type4 can be any complex types -->
> <xs:element name="X">
>      <xs:complexType>
>          <xs:union memberTypes="Type3 Type4" />
>      </xs:complexType>
> </xs:element>
>

Hypothetically speaking, with the WG specifying xs:union within
xs:complexType, how would you specify the case when a complex type derives
from another complex type having xs:union as a direct child? Or, would you
like specifying that a complex type cannot derive from
xs:complexType->xs:union (for simplifying this facility)?

Also, when I say,

<xs:complexType>
     <xs:union memberTypes="Type3 Type4" />
</xs:complexType>

I mean that, cardinality of list of types Type3 Type4 can be 2...n.



-- 
Regards,
Mukul Gandhi
Received on Monday, 19 July 2021 04:51:30 UTC

This archive was generated by hypermail 2.4.0 : Monday, 19 July 2021 04:51:31 UTC