title: XSD restrict element occurrence with an specific attribute
body: <p>I try to define a complex type for a selection that can consist of different type of entries 
  but only one entry is allowed to have an attribute "multiselect".</p>
  
  <p>Here is what I tried:</p>
  
  <pre><code>&lt;element name="selection" minOccurs="0" maxOccurs="unbounded"&gt;
    &lt;complexType&gt;
      &lt;sequence&gt;
        &lt;element name="name" type="string" /&gt;
        &lt;element name="source"&gt;
          &lt;complexType&gt;
            &lt;choice&gt;
              &lt;element name="item" minOccurs="1" maxOccurs="unbounded" type="string" /&gt;
              &lt;element name="path" type="string" minOccurs="1" maxOccurs="1" /&gt;
            &lt;/choice&gt;
          &lt;/complexType&gt;  
        &lt;/element&gt;
      &lt;/sequence&gt;
      &lt;attribute name="multiselection" type="boolean" minOccurs="1" maxOccurs="1" /&gt;
    &lt;/complexType&gt;
  &lt;/element&gt;
  </code></pre>
  
  <p>The result should be that there can be more elements of "selection" where it doesn't matter if the source is of type "item" or of type "path". But only one of the "selection" elements is allowed to to have the attribute multiselection = true.</p>
  
  <p>But as it seems there is no min-/maxOccures for attributes.
  How can I workaround this ?</p>
  
  <p>Thx </p>