Full error message:
[Error] try.xsd:5:15: cos-all-limited.2: The {max occurs} of an element in an 'all' model group must be 0 or 1. The value 'unbounded' for element 'Child2' is invalid.
I have the following XML documents:
One
<Parent>
<Child1>value</Child1>
<Child2>value</Child2>
<Child3>value</Child3>
<Child2>value</Child2>
<Child3>value</Child3>
<Child4>value</Child4>
<Child5>value</Child5>
</Parent>
Two
<Parent>
<Child5>value</Child5>
<Child1>value</Child1>
<Child2>value</Child2>
<Child3>value</Child3>
<Child2>value</Child2>
<Child3>value</Child3>
<Child4>value</Child4>
</Parent>
The elements appear in any order. So I defined the schema like this:
<xs:element name="Parent">
<xs:complexType>
<xs:all>
<xs:element name="Child1" type="xs:int" minOccurs="0"/>
<xs:element name="Child2" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Child3" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Child4" type="xs:string" minOccurs="0"/>
<xs:element name="Child5" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
I am facing two issues:
- Unbounded is not allowed with
xs:all
. - Is there any way to define a relationship between
Child2
andChild3
.