I trying to create/correct the following XSD to match program logic. Current non-XSD logic allows the following attributes (XML representation below) to be parsed in any ordered. I am very green with XSD. This would be a valuable tool for parsing validation. Can XSD be created to allow processing of these attributes in any order to allow maxOccurs for Susp_O_CD? I know sequence will allow maxOccurs and all doesn't, but Susp_O_CD must be allowed to have up to five values, and any input order for StReas, StReas_N, ListSusp_T, and Susp_O_CD tags are required.
<PrimaryReason>
<StReas>2</StReas>
<StReas_N>Reason for stop test</StReas_N>
<ListSusp_T>
<Susp_T>8</Susp_T>
<Susp_T>4</Susp_T>
</ListSusp_T>
<Susp_O_CD>00100</Susp_O_CD>
<Susp_O_CD>00200</Susp_O_CD>
<Susp_O_CD>00101</Susp_O_CD>
<Susp_O_CD>00201</Susp_O_CD>
</PrimaryReason>
XSD:
<xs:element name="PrimaryReason" type="Reason_Set"/>
<xs:complexType name="Reason_Set">
<xs:all>
<xs:element name="StReas" type="StReas"/>
<xs:element name="StReas_N" type="StReas_N"/>
<xs:element name="Tr_ID" type="Tr_ID" minOccurs="0"/>
<xs:element name="Tr_O_CD" type="Tr_O_CD" minOccurs="0"/>
<xs:element name="EDU_sec_CD" type="EDU_sec_CD" minOccurs="0"/>
<xs:element name="EDU_subDiv_CD" type="EDU_subDiv_CD" minOccurs="0"/>
<xs:element name="ListSusp_T" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Susp_T" type="Susp_T" minOccurs="0" maxOccurs="9"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Susp_O_CD" type="Susp_O_CD" minOccurs="0" maxOccurs="5"/>
</xs:all>
</xs:complexType>
Hopefully this can be done. I did try Group but it doesn't work with all tag. All suggests are welcome.