XML technologies / XML Schema / XML Schema element reference / xs:choice (within a group)

(Excerpt from “XML Schema” by Eric van der Vlist)

Compositor defining a group of mutually exclusive elements or compositors. Occurrence frequency cannot be specified when xs:choice is used within a group.

<xs:choice
    id = xs:ID
    {beliebige Attribute mit einem Nicht-Schema-Namensraum}
    >
    Content: (xs:annotation?, (xs:element | xs:group | xs:choice | xs:sequence | xs:any)
    )*)
</xs:choice>

May occur within: xs:group (definition)

Description

Within a group definition, compositor xs:choice has its usual function, except that occurrence frequency is defined on the xs:group reference rather than through attributes minOccurs and maxOccurs of the xs:choice compositor.

Restrictions

Attributes minOccurs and maxOccurs, allowed in other contexts, are forbidden here.

Example

<xs:group name="author-or-character">
   <xs:choice>
      <xs:element ref="author"/>
      <xs:element ref="character"/>
   </xs:choice>
</xs:group>

Attributes

id
Element ID according to W3C XML Schema.

   

 

 

 

back to top