Allow the document instance author to use the initial element twice : choice « XML Schema « XML Tutorial






<xsd:element name="middleName">
  <xsd:complexType>
   <xsd:choice>
    <xsd:element name="initial" type="xsd:string" maxOccurs="2"/>
    <xsd:element name="name" type="xsd:string"/>
   </xsd:choice>
  </xsd:complexType>
</xsd:element>








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.