Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema sequence Element

XML Schema sequence Element


XML Schema Reference Manual 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

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.)

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

This example is a declaration for the "personinfo" element, which must contain the following 5 elements in order: "firstname", "lastname", "address", "city", and "country".

  xs:complexType

    xs:sequence

      

      

      

      

      

    

  

Example 2

This example is a declaration for the "pets" element, which can contain zero or more dog and cat elements:

  xs:complexType

    

      

      

    

  


XML Schema Reference Manual Complete XML Schema Reference Manual