[xsd-users] Element order

Mathew Benson mathew.benson at gmail.com
Sun Mar 23 23:34:32 EDT 2014


XSD didn't generate code that I expected.  My xsd file has the following
definition:

<complexType name="CommandContainerEntryListType" mixed="false">
  <choice minOccurs="0" maxOccurs="unbounded">
  <element name="ParameterRefEntry" type="xtce:ParameterRefEntryType"/>
  <element name="ParameterSegmentRefEntry"
type="xtce:ParameterSegmentRypeefEntryType"/>
  <element name="ContainerRefEntry" type="xtce:ContainerRefEntryType"/>
  </choice>
</complexType>

an XML snippet might look like:

<ParameterRefEntry/>
<ParameterSegmentRefEntry/>
<ParameterRefEntry/>
<ParameterRefEntry/>
<ContainerRefEntry/>

Maybe the xsd is defined wrong, but its supposed to be an ordered list of a
mix of various elements. The problem is the generated code results in
separate sequences of each separate element so overall order within the
container is lost. What can I do to retain order?


More information about the xsd-users mailing list