I've the following XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<props>
<id>someId</id>
<file_size>
<size>123</size>
<unit>MB</unit>
</file_size>
<file_size>
<size>123</size>
<unit>MB</unit>
</file_size>
</props>
And the corresponding XSD:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified" elementFormDefault="qualified">
<xs:element name="props">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="id" />
<xs:element name="file_size" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:int" name="size" />
<xs:element type="xs:string" name="unit" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
My goal is to allow unordered elements and i saw ALL indicator solution
but, how can i maintain the file_size behavior? I found some solutions to put:
<file_size>
<size>123</size>
<size>125</size>
<unit>MB</unit>
<unit>TB</unit>
</file_size>
but i need to have several file_size (with one size and one unit).
To resume, all of the children of props to be in any order but have any number of file_size elements.
How can i handle this?