I'd like to be able to specify single choice type for multiple extending types.
For example, say we have the sea, in the sea there are many kinds of fishes. So in XML I will write:
<Sea name="Atlantic Ocean">
<Tuna name="tuna1" />
<Carp name="carp1" />
<Carp name="carp2" />
<Tuna name="tuna2" />
<Salmon name="salmon1" />
</Sea>
XSD
<xs:complexType name="Fish">
</xs:complexType>
<xs:complexType name="Salmon">
<xs:complexContent>
<xs:extension base="Fish">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Carp">
<xs:complexContent>
<xs:extension base="Fish">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Tuna">
<xs:complexContent>
<xs:extension base="Fish">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Sea">
<xs:complexContent>
<xs:extension base="GeoZone">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element type="Fish" name="Fish" minOccurs="0"
maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="optional" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
Unfortunately, that is not valid, as I can only add the type Fish
itself and not its extending types.