Name

xs:choice

Attributes

maxOccurs

Any non-negative integer or unbounded. (Defaults to 1, but cannot be specified when xs:choice appears inside an xs:group element.)

minOccurs

Any non-negative integer. (Defaults to 1, but cannot be specified when xs:choice appears inside an xs:group element.)

Contents

xs:annotation?, ( xs:element | xs:group | xs:choice |
                  xs:sequence | xs:any )*

The xs:choice element specifies that any one of the definitions included inside it (xs:element, xs:group, xs:choice, xs:sequence, or xs:any) may appear. When the xs:choice element is used outside an xs:group element, the maxOccurs and minOccurs attributes may set the number of times this choice can happen. The default is 1, but it can be set higher—even to unbounded—allowing the creation of elements that contain an arbitrary number of mixed elements.

Get XML Pocket Reference, 3rd Edition 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.