I have something like this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="PRO">
<xs:sequence>
<xs:element ref="LIC" minOccurs="0"
maxOccurs="unbounded">
</xs:element>
<xs:element ref="SPEC" minOccurs="0"
maxOccurs="unbounded">
</xs:element>
<xs:element ref="NPI" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LIC">
</xs:complexType>
<xs:complexType name="SPEC">
</xs:complexType>
<xs:complexType name="NPI">
</xs:complexType>
<xs:element name="LIC" type="LIC">
</xs:element>
<xs:element name="SPEC" type="SPEC">
</xs:element>
<xs:element name="NPI" type="NPI">
</xs:element>
</xs:schema>
I want to re-arrange xsd as given below:
<xs:sequence>
<xs:element ref="NPI" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element ref="SPEC" minOccurs="0"
maxOccurs="unbounded">
</xs:element>
<xs:element ref="LIC" minOccurs="0"
maxOccurs="unbounded">
</xs:element>
</xs:sequence>
There is no specific rule for sorting but just this order is what needed. This is just a sample.
Thanks in advance. Biju