title: Is it valid to have a 'choice' of 'group' elements when defining an XML Schema (XSD)
body: <p>Is it valid to have a 'choice' of 'group' elements when defining an XML Schema (XSD)</p>
  <p>i.e. is the following valid</p>
  <pre><code>&lt;xs:complexType name=&quot;HeaderType&quot;&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name=&quot;reservation-number&quot; type=&quot;ReservationNumberType&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;false&quot; /&gt;
      &lt;xs:choice minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;&gt;
        &lt;xs:group ref=&quot;ReservationGroup&quot; /&gt;
        &lt;xs:group ref=&quot;CancellationGroup&quot;/&gt;
      &lt;/xs:choice&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  <p>Where an XML message can represent, for example, either a new reservation or a cancellation of an existing reservation.</p>
  <p>If the message is for a reservation, then it must include all the elements defined in the ReservationGroup group.</p>
  <p>If it is a cancellation, then it must include all the elements defined in the CancellationGroup group.</p>
  <p>For some reason, my XML editor (Eclipse) does not like this, but does not indicate why. It shows there being an error on the line &lt;xs:complexType name=&quot;HeaderType&quot;&gt; but does not say what the error is</p>