title: How to write a valid xsd for elements with the same name, but with different content
body: <p>We're having some issues writing the correct (valid) xsd:
  - the xsd should validate on <a href="http://www.w3.org/2001/03/webdata/xsv" rel="nofollow">http://www.w3.org/2001/03/webdata/xsv</a>
  - it should be possible to add the schema to an sql server schema collection (CREATE XML SCHEMA COLLECTION test AS '[xsd here]'
  - we need the 'title' attribute values to be specified in the xsd</p>
  
  <p>This is (a drastically simplified) XML structure:
  
    
    
  </p>
  
  <p>1) This was our first version (which obviously is not valid): You cannot have 2 elements with name 'input' which <em>are different</em>.</p>
  
  <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"&gt;
      &lt;xsd:element name="test"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element name="input"&gt;
                      &lt;xsd:complexType&gt;
                          &lt;xsd:attribute name="title" fixed="Pretty title" use="required"/&gt;
                      &lt;/xsd:complexType&gt;
                  &lt;/xsd:element&gt;
                  &lt;xsd:element name="input"&gt;
                      &lt;xsd:complexType&gt;
                          &lt;xsd:attribute name="title" fixed="Different title" use="required"/&gt;
                      &lt;/xsd:complexType&gt;
                  &lt;/xsd:element&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  </code></pre>
  
  <p></p>
  
  <p>2) second attempt:</p>
  
  <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"&gt;
  &lt;xsd:element name="test" type="Test"/&gt;
  &lt;xsd:complexType name="input1"&gt;
      &lt;xsd:attribute name="title" fixed="Pretty title" use="required"/&gt;
  &lt;/xsd:complexType&gt;
  &lt;xsd:complexType name="input2"&gt;
      &lt;xsd:attribute name="title" fixed="Different title" use="required"/&gt;
  &lt;/xsd:complexType&gt;
  &lt;xsd:complexType name="Test"&gt;
      &lt;xsd:sequence&gt;
          &lt;xsd:element name="input" type="input1"/&gt;
          &lt;xsd:element name="input" type="input2"/&gt;
      &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p></p>
  
  <ul>
  <li>w3.org comes up with the same error message as before: illegal redeclaration of {None}:input</li>
  <li>xmlspy tells us it's a valid xsd</li>
  <li>sql server throws an error: The content model of type 'Test' contains two elements with the same name 'input' and different types, nillability, or value constraints.</li>
  </ul>
  
  <p>It would be great if someone can give us some insight on this.</p>
  
  <p>Manu.</p>
  
  <p>ps: In reality, our XML structures are way more complex then the example. We're building a web form generator.
  Here's another (still simple) example:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ZForm title="main title" attachment="attachment1" type="NM08"&gt;
  &lt;Part title="part title"&gt;
      &lt;SubTitle code="I.1)" title="title 1"/&gt;
      &lt;ShortText title="short text title 1"/&gt;
      &lt;SubTitle code="I.2)" title="title 2" subtitle="subtitle 1"/&gt;
      &lt;SelectList type="select type" title="select title"/&gt;
      &lt;ShortText title="short text title 2"/&gt;
      &lt;MultiSelectList type="multiType2" title="multi select title"/&gt;     
      &lt;RadioButtonList type="yesNo" title="lala"/&gt;
      &lt;SubTitle code="I.3)" title="some other title" subtitle="what?"/&gt;
      &lt;MultiSelectList type="multiType2" title=""/&gt;
  &lt;/Part&gt;
  &lt;Part title="second part title"&gt;
      &lt;Repeater add="add a new repeater item" remove="remove last repeating part"&gt;
          &lt;RepeatingPart&gt;
              &lt;SubTitle code="II.1)" title="tiiiiiitle"/&gt;
              &lt;ShortText/&gt;
          &lt;/RepeatingPart&gt;
      &lt;/Repeater&gt;
  &lt;/Part&gt;
  &lt;/ZForm&gt;
  </code></pre>