Name

xs:sequence(outside a group) — Compositor to define an ordered group of elements.

Synopsis

<xs:sequence
           id                 = xs:ID
           maxOccurs          = ( xs:nonNegativeInteger | “unbounded” ) : “1”
           minOccurs          = xs:nonNegativeInteger : “1”
           {any attributes with non-schema namespace}
           >
           Content: (xs:annotation?, (xs:element | xs:group | xs:choice |
                      xs:sequence | xs:any) )*)
</xs:sequence>

May be included in: xs:choice (outside a group), xs:choice (within a group), xs:complexType (local definition), xs:complexType (global definition), xs:extension (complex content), xs:restriction (complex content), xs:sequence (within a group), xs:sequence (outside a group)

Description

This compositor is used to define an ordered list or set of elements. It can hold its own minOccurs and maxOccurs attributes to define a number of occurrences of the whole sequence.

Restrictions

xs:sequence may not be included in an xs:all compositor, and xs:sequence may not include xs:all compositors.

When xs:sequence is included in an xs:group compositor, its content model is slightly different (see xs:sequence(within a group) (within a group)).

Example

<xs:element name="library">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="book" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

Attributes

id

W3C XML Schema’s element ID.

maxOccurs

Maximum number of occurrences.

minOccurs

Minimum number of occurrences.

Get XML Schema now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.