title: XSD for elements string with attribute id
body: <p>I would like to write a XSD element that permit something like that :</p>
  
  <pre><code>&lt;CustomFields&gt;
      &lt;CustomField id="1"&gt;some text data&lt;/CustomField&gt;
      &lt;CustomField id="2"&gt;some text data&lt;/CustomField&gt;
  &lt;/CustomFields&gt;
  </code></pre>
  
  <p>But I have some restrictions : I have to restrict the text (maxLenght = 36). And I would like to be impossible to have 2 CustomField with the same id.</p>
  
  <p>So far I wrote this, but it not what I want :</p>
  
  <pre><code>&lt;xs:element name="CustomFields" minOccurs="0"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="CustomField" minOccurs="0" maxOccurs="20"&gt;
                  &lt;xs:complexType&gt;
                      &lt;xs:simpleContent&gt;
                          &lt;xs:extension base="xs:string"&gt;
                              &lt;xs:attribute name="id" type="xs:integer" use="required"&gt;&lt;/xs:attribute&gt;
                          &lt;/xs:extension&gt;
                      &lt;/xs:simpleContent&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>Thanks for any help.</p>
  
  <p>Regards.</p>