XML Schema sequence Element
Complete XML Schema Reference Manual
Definition and Usage
The sequence element requires the elements in the group to appear in the specified order in the containing element. Each child element can appear zero to any number of times.
Element Information
- Parent elements: group, choice, sequence, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent)
Syntax
id=ID maxOccurs=nonNegativeInteger|unbounded minOccurs=nonNegativeInteger any attributes (annotation?,(element|group|choice|sequence|any)*) (The ? declares that within the sequence element, the element can appear zero or one time.) This example is a declaration for the "personinfo" element, which must contain the following 5 elements in order: "firstname", "lastname", "address", "city", and "country". This example is a declaration for the "pets" element, which can contain zero or more dog and cat elements:
property
Description
id
Optional. Specifies a unique ID for the element.
maxOccurs
Optional. Specifies the maximum number of times the any element can appear in the parent element. The value can be an integer greater than or equal to zero. If you do not want to set any limit on the maximum, use the string "unbounded". The default is 1.
minOccurs
Optional. Specifies the minimum number of times the any element can appear in the parent element. The value can be an integer greater than or equal to zero. To specify that the any group is optional, set this attribute to zero. The default is 1.
any attributes
Optional. Specifies any other attributes with a non-schema namespace.
Example 1
Example 2
Complete XML Schema Reference Manual