Is it possible to do something like this in an XML schema?
<xsd:complexType name="ItemsType"> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element ref="shirt"/> <xsd:element ref="hat"/> <xsd:element ref="umbrella"/> </xsd:choice> <xsd:choice minOccurs="1" maxOccurs="3"> <xsd:element ref="apple"/> <xsd:element ref="banana"/> <xsd:element ref="strawberry"/> </xsd:choice> </xsd:complexType>
this is apparently invalid. I would like it to be possible to have 0 or more from the first choice. there may be a shirt element and a hat element, or perhaps no clothes elements at all (since minOccurs = "0"), followed by at least 1 fruit element (I want to make it at least one, since MinOccurs = "1").
Is there any way to do this?
Thanks for any help.
source share