Order indicators define the order or sequence in which child elements can occur in an XML document. The following table lists the order indicators. |
Indicator |
Description |
Example |
|
Specifies that the complexType element must contain child elements, and the child elements must appear in the specified order |
<xs:element name="EmpName">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
The EmpName element must contain firstname and lastname elements, and the firstname element must appear before the lastname element. |
|
Specifies that the complexType element can contain child elements in any order, and the child elements must occur only once |
<xs:element name="DeptID">
<xs:complexType>
<xs:all>
<xs:element
name="DeptNumber" type="xs:string"/>
<xs:element name="LocationID"
type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
The DeptID element must contain DeptNumber and LocationID elements in any order, and the child elements must appear only once. |
|
Specifies that the complexType element can contain either of the two child elements |
<xs:element name="Employee">
<xs:complexType>
<xs:choice>
<xs:element name="permanent" type="xs:string"/>
<xs:element name="temporary" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
The Employee element must contain either the permanent or temporary element.
|