title: minOccurs and maxOccurs on elements inside xsd:choice
body: <p>I have a root element <code>&lt;a&gt;</code> and its children <code>&lt;b&gt;, &lt;c&gt;, &lt;d&gt;</code></p>
  
  <p>Here's what I need:</p>
  
  <ul>
  <li>the child elements can appear in any order</li>
  <li>just 1 <code>&lt;b&gt;</code></li>
  <li>more than 1 <code>&lt;c&gt;</code></li>
  <li>0 or 1 <code>&lt;d&gt;</code></li>
  </ul>
  
  <p>For example:</p>
  
  <pre><code>&lt;a&gt;
      &lt;c /&gt;
      &lt;b /&gt;
      &lt;c /&gt;
      &lt;d /&gt; 
  &lt;/a&gt;
  </code></pre>
  
  <p>And here is my XSD:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified"
             attributeFormDefault="unqualified"&gt;
    &lt;xs:element name="a"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:choice&gt;
          &lt;xs:element name="b" /&gt;
          &lt;xs:element name="c" minOccurs="1" maxOccurs="unbounded"/&gt;
          &lt;xs:element name="d" minOccurs="0" maxOccurs="1"/&gt;
        &lt;/xs:choice&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>But the <code>minOccurs</code> and <code>maxOccurs</code> in <code>xs:element</code> may not work. When I run the example, I got an error:</p>
  
  <blockquote>
    <p>Element <code>&lt;b&gt;</code> is not allowed at this location under element <code>&lt;a&gt;</code>.</p>
  </blockquote>
  
  <p>How can I fix this?</p>