———
|
Table of Contents
XML Schema all ElementDefinition and UsageThe all element specifies that the child elements can appear in any order and that each child element can occur zero or one time. Element Information
Syntax<all id=ID maxOccurs=1 minOccurs=0|1 any attributes > (annotation?,element*) </all> (The ? sign declares that the element can occur zero or one time, and the * sign declares that the element can occur zero or more times inside the all element)
Example 1<xs:element name="person"> <xs:complexType> <xs:all> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> </xs:all> </xs:complexType> </xs:element> The example above indicates that the “firstname” and the “lastname” elements can appear in any order but both elements MUST occur once and only once! Example 2<xs:element name="person"> <xs:complexType> <xs:all minOccurs="0"> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> </xs:all> </xs:complexType> </xs:element> The example above indicates that the “firstname” and the “lastname” elements can appear in any order and each element CAN appear zero or one time! |