I have an element A
with children B
and C
.
They can occur in any order but:
B
should unlimited or not at allC
can occur only once or not at all
I tried to do it with <xs:all>
but it doesn't accept maxOccurs="unbounded"
.
Example Code:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="A">
<xs:complexType>
<xs:all>
<xs:element name="B" minOccurs="0"
maxOccurs="unbounded" type="xs:string"/>
<xs:element name="C" minOccurs="0"
maxOccurs="1" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
Is here another way to accomplish this?