[xsd-users] Support of sequence of choice elements

Daniel Gustafsson Daniel.Gustafsson at atollic.com
Mon Sep 6 08:11:13 EDT 2010


Hi,
I have a part in my xsd schema that looks like this

<xsd:complexType name="MyListType">
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:choice>
           <xsd:element name="Element_A" type="Element_A_Type"> </xsd:elemet>
           <xsd:element name="Element_B" type="Element_B_Type"></xsd:element>
        </xsd:choice>
    </xsd:sequence>
</xsd:complexType>

That is, I have a list there Element_A and Elemet_B elements can be mixed as wanted.
As I understand, in the xsd data model, my list will be represented as two separate lists;
One list with the Element_A types and one list with the Element_B types.
However, in my application the order of the elements in the list as they appear in the xml file are important.
Does xsd support any way to iterate over  my list and keep the order of the elements intact??
Or do I have to change the schema somehow?

Regards,
Daniel Gustafsson


Daniel GUSTAFSSON
Software Engineer, M.Sc.C.Sc.

+46 (0)36 19 60 55 (direct)
+46 (0)36 19 60 50 (main)
daniel.gustafsson at atollic.com
www.atollic.com

Atollic AB
Science Park Jönköping
Gjuterigatan 9
SE-553 18 Jönköping
Sweden

IMPORTANT NOTICE:
"The information in this email, including any attachments, may
only be used by the intended recipient. If you received this
email in error, please contact the sender and delete or destroy
the material immediately. Thank you."



More information about the xsd-users mailing list