title: xml schema - single and multi element occurrence
body: <p>I have an XML schema with my "video" element and "youtube" element inside:</p>
  
  <pre><code>&lt;xs:element name="video"&gt;
    &lt;xs:complexType&gt;            
      &lt;xs:sequence&gt;     
        &lt;xs:element ref="youtube" minOccurs="0" maxOccurs="1"/&gt;
      &lt;/xs:sequence&gt;    
      &lt;xs:attribute name="file" type="xs:string"/&gt;
    &lt;/xs:complexType&gt;  
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>and I want to add to available video types another element "param":</p>
  
  <pre><code>&lt;xs:element name="param"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
       &lt;xs:attribute name="value" type="xs:string" use="required"/&gt;
     &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;    
  </code></pre>
  
  <p>I would have "param" element inside next to "youtube".</p>
  
  <p>Restrictions:</p>
  
  <ul>
  <li>youtube can occur only one time in my xml</li>
  <li>param - can occur many times in my xml</li>
  </ul>
  
  <p>like this:</p>
  
  <pre><code>&lt;video&gt;
  &lt;youtube file = "aaa"/&gt;
  &lt;param name="a1" value"b1"/&gt;
  &lt;param name="a2" value"b2"/&gt;
  &lt;/video&gt;
  </code></pre>
  
  <p>How to maintain this restrictions in this schema?</p>
  
  <p>If I do something like this:</p>
  
  <pre><code>&lt;xs:sequence&gt;     
        &lt;xs:element ref="youtube" minOccurs="0" maxOccurs="1"/&gt;
        &lt;xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;/xs:sequence&gt;    
  </code></pre>
  
  <p>if the sequence is specified like this</p>
  
  <pre><code>&lt;xs:sequence&gt;     
        &lt;xs:element ref="youtube" minOccurs="0" maxOccurs="1"/&gt;
        &lt;xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;/xs:sequence&gt;    
  </code></pre>
  
  <p>it determines that param has to be after youtube - but I don't want to specify the sequence</p>