I have an issue where I need to output a set of objects in the order in which they were input. I'm trying to determine if there is a way within the objects created by liquid from an xsd to add a key that allows me to specify the order for output.
To summary, we have one object that can contain an unknown number of 4 types of subobjects. Those 4 subobjects are used to generate a mathematical formula. I have a table that keeps track of the order of those subobjects as they come in. Currently, the exporter exports the objects grouped by object type. They are sorted properly within the object type, but I need the exporter to ignore the grouping by object type and output by a specific order. How do I tell the exporter to do that.
Below is a subset of the XSD, a subset of the input file, and how the output is currently generated.
<complexType name="MainType">
<annotation>
<documentation xml:lang="en">
Describe a mathematical function.
</documentation>
</annotation>
<complexContent>
<extension base="xtce:BaseType">
<choice maxOccurs="unbounded">
<element name="Subtype1" type="type1">
</element>
<element name="Subtype2" type="type2">
</element>
<element name="Subtype3" type="type3">
</element>
<element name="Subtype4" type="type4">
</element>
</choice>
</extension>
</complexContent>
</complexType>
Input file, and desired output
<MainType>
<Subtype1>aaa</Subtype1>
<Subtype2>bbb</Subtype2>
<Subtype1>ccc</Subtype1>
<Subtype2>ddd</Subtype2>
<Subtype3>eee</Subtype3>
<Subtype4>fff</Subtype4>
<Subtype3>ggg</Subtype3>
<Subtype1>hhh</Subtype1>
</MainType>
Current output file
<MainType>
<Subtype1>aaa</Subtype1>
<Subtype1>ccc</Subtype1>
<Subtype1>hhh</Subtype1>
<Subtype2>ddd</Subtype2>
<Subtype2>bbb</Subtype2>
<Subtype3>eee</Subtype3>
<Subtype3>ggg</Subtype3>
<Subtype4>fff</Subtype4>
</MainType>