I need to write an XML schema that accept XMLs such as:
<?xml version="1.0" encoding="utf-8"?>
<Data>
<NodeA>something</NodeA>
<NodeB>something</NodeB>
<NodeC>something</NodeC>
<NodeD>something</NodeD>
</Data>
<?xml version="1.0" encoding="utf-8"?>
<Data>
<NodeA>something</NodeA>
<NodeC>something</NodeC>
<NodeB>something</NodeB>
<NodeD>something</NodeD>
</Data>
So in general, I want the elements in the list to be sequenced, except that a part of the list can appear in any order.
However I tried several appoaches for the xsd file and none of them works, e.g.
<xs:complexType name="Data">
<xs:sequence>
<xs:element name="NodeA"/>
<xs:all xmlns:xs="">
<xs:element name="NodeB"/>
<xs:element name="NodeC"/>
</xs:all>
<xs:element name="NodeD"/>
</xs:sequence>
</xs:complexType>
Putting NodeB and NodeC in a group doesn't work either.
I've googled those error messages but couldn't find anything useful...Why these xsds fails and how should I write it? Thanks!