I’ve got a XML Schema (xsd file) snippet bellow, in which I want the NAME and ADRESS elements to appear in any order, but always before the FILM sequence.
So I’ve been trying to do like this :
<xs:element name="ROOM">
<xs:complexType>
<xs:all>
<xs:element ref="NAME"/>
<xs:element ref="ADRESS"/>
</xs:all>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="FILM"/>
</xs:sequence>
<xs:attribute name="group" type="xs:NCName"/>
<xs:attribute name="typ" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
I know that the <xs:all> tag cannot be part of an element with other elements at the same child-level … but can’t find a way out …
Any suggestions ? Thanks in advance !
Ok, looks like I’ve found a way eventually :
But I assume that it’s not very optimized, considering that if you want to do this with 10 elements, you have to specify all permutations …