Declarations : choice « XML Schema « XML Tutorial






<choice minOccurs="non negative number" 
        maxOccurs="non negative number or unbounded"> 

You can specify multiple child declarations within a <choice> declaration. 
In an instance document, only one of the declarations may be used. 

<choice> 
    <element name="first" type="string" minOccurs="1" maxOccurs="unbounded"/> 
    <element name="middle" type="string" minOccurs="0" maxOccurs="1"/> 
    <element name="last" type="string"/> 
</choice> 

<choice> declaration may contain <element> declarations, element wild-cards, and inner <sequence>, <choice>, or <group>references.








3.58.choice
3.58.1.Creating a Set of Choices
3.58.2. Declarations
3.58.3.Allow the document instance author to use the initial element twice
3.58.4.You can further express occurrence behavior by using the minOccurs and maxOccurs attributes with either the choice element or the element declarations themselves.