I am trying to check the order of the child elements in an xml,
My xml is
<main>
<col name="name1">test1</col>
<col name="name2">test2</col>
<col name="name3">test3</col>
<col name="name4">test4</col>
<col name="num1">true</col>
</main>
and I need to verify if the child elements are getting displayed in the correct order. The child elements in my file all have the same name but different attributes.
<xs:element minOccurs="0" maxOccurs="unbounded" name="col">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type ="OrderCheck" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
I would ideally like to do
<xs:complexType name="OrderCheck">
<xs:sequence>
<xs:element name="name1" type="xs:string"/>
<xs:element name="name2" type="xs:string"/>
<xs:element name="name3" type="xs:string"/>
<xs:element name="name4" type="xs:string"/>
<xs:element name="num1" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
For me to be able to use xs:sequence I need to define a xs:complexType but I am not able to define a complexType under the "attribute" type, I can define only a simple type.But I cannot use xs:sequence under simpleType. How can I fix this?