Sorry if there's an obvious answer to this....I've been digging and playing and can't get this to work....
I am having problems enforcing the order of optional fields.
In my schema I've defined a complex type that is composed of other complex types. Not all of the composing types have to be present, but whichever are present must be in a specific order.
For some reason, the schema doesn't enforce the order. I've been reading and playing with different combinations of xs:choice and xs:sequence. Doesn't matter what order the composing types are in my XML file - file is unmarshalled and parsed with no complaints (using JAXB).
How can I enforce the order of the composing types? What am I missing here? Here is a snippet of the schema, I didn't include definitions of the composing types. My XML file contains txType2 followed by txType1 and doesn't complain about the sequence.
<xs:complexType name="TransactionCollection">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:appinfo>
<jxb
roperty name="TransactionCollection"/>
</xs:appinfo>
</xs:annotation>
<xs:sequence>
<xs:element name="txType1" type="TxType1" minOccurs="0"/>
<xs:element name="txType2" type="TxType2" minOccurs="0"/>
<xs:element name="txType3" type="TxType3" minOccurs="0"/>
<xs:element name="txType4" type="TxType4" minOccurs="0"/>
<xs:element name="txType5" type="TxType5" minOccurs="0"/>
<xs:element name="txType6" type="TxType6" minOccurs="0"/>
</xs:sequence>
</xs:choice>
</xs:complexType>
Thanks in advance for your time and assistance...