title: XSD inheritance and xhtml form
body: <p>I am looking for an XSD describing a class of instances. I'll explain what I am trying to accomplish with an instance example. I would like to have an XSD type (let's call it FormBaseType) describing this instance:</p>
  
  <pre><code>&lt;form method="post" action="someaction" name="acme"&gt;
      &lt;input name="EXACTLY FOO" value="EXACT ENUMERATION" type="CONST STRING" /&gt;
      &lt;input name="SOME RANDOM STRING" value="SOME RANDOM STRING" type="CONST STRING" /&gt;
      &lt;input name="SOME RANDOM STRING" value="SOME RANDOM STRING" type="CONST STRING" /&gt;
      ... (input element repeats up to 30 times) ...
  &lt;/form&gt;
  </code></pre>
  
  <p>Than I would like a OneKindOfMyFormType to inherit and restrict the FormBaseType so that it matches only such instances:</p>
  
  <pre><code>&lt;form method="post" action="someaction" name="acme"&gt;
      &lt;input name="EXACTLY FOO" value="EXACT ENUMERATION" type="CONST STRING" /&gt;
      &lt;input name="EXACTLY BAR" value="SOME RANDOM STRING RESTRICTION" type="CONST STRING" /&gt;
      &lt;input name="EXACTLY BAZ" value="SOME OTHER RANDOM STRING RESTRICTION" type="CONST STRING" /&gt;
      ... (input element repeats up to 30 times) ...
  &lt;/form&gt;
  </code></pre>
  
  <p>I'm running into a problem when trying to define multiple input elements that are restricted in different ways. I can have multiple input elements of same type like this:</p>
  
  <pre><code>&lt;xs:complexType name="FormBaseType"&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="input" type="ns0:InputType" minOccurs="1" maxOccurs="33"/&gt;
      &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>But when I try this:</p>
  
  <pre><code>&lt;xs:complexType name="RequestType"&gt;
      &lt;xs:complexContent&gt;
          &lt;xs:restriction base="RequestTypeBase"&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="input" type ="ns0:AlphaNumericInputType" minOccurs="1" maxOccurs="1" /&gt;
                  &lt;xs:element name="input" type ="ns0:NumericInputType" minOccurs="1" maxOccurs="1" /&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>there is a problem that elements of the same name ("input") and in the same scope must have the same type. (AlphaNumericInputType and NumericInputType are restrictions of InputType, but it doesn't really matter for the example except perhaps clarifying my intent).</p>
  
  <p>Long story short I would like to have an XSD description of multiple forms where some of the <em>input</em> elements are the same throughout various kinds of forms (the base), and also in derived XSD types <em>input</em> elements that have the base attribute <em>type</em> plus an exact <em>name</em> attribute value and for that exact name a <em>value</em> attribute type restriction.</p>
  
  <p>Is this possible? How?</p>
  
  <p>TIA</p>