title: XSD: define complex element with attribute and other child elements
body: <p>I want to define an element like this:</p>
  
  <pre><code>&lt;A id='1'&gt;
    &lt;name&gt;jack&lt;/name&gt;
  &lt;/A&gt;
  </code></pre>
  
  <p>With this below I could define attribute <code>id</code> of element A:</p>
  
  <pre><code>&lt;xs:complexType name="A"&gt;
      &lt;xs:simpleContent&gt;
        &lt;xs:extension base="xs:string"&gt;
          &lt;xs:attribute type="xs:int" name="id"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:simpleContent&gt;
    &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>Actually it's not correct, the XSD above defines an element <code>&lt;A id="1"&gt;hi&lt;/A&gt;</code>. I don't know how to discard the base attribute of <code>&lt;xs:extension&gt;</code> element.</p>
  
  <p>And with the XSD below I could define the inside element <code>&lt;name&gt;</code>:</p>
  
  <pre><code>&lt;xs:element name = "A"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
  
              &lt;xs:element name = "name" type="xs:string"/&gt;
  
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>Could I combine this two together like this below? I could not get the syntax correct.</p>
  
  <pre><code>    &lt;xs:element name = "A"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name = "name" type="xs:string"/&gt;                       
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
          &lt;xs:simpleContent&gt;
            &lt;xs:extension&gt;
              &lt;xs:attribute type="xs:int" name="id"/&gt;
            &lt;/xs:extension&gt;
          &lt;/xs:simpleContent&gt;
      &lt;/xs:element&gt;
  </code></pre>