title: How to Reuse a locally defined element under the Same Parent Tag
body: <p>Why Does not 'ref' work in this case :</p>
  
  <pre><code>&lt;xs:complexType name="Team"&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="Name" type="xs:string"/&gt;
          &lt;xs:element name="Size"&gt;
              &lt;xs:simpleType&gt;
                  &lt;xs:restriction base="xs:integer"&gt;
                      &lt;xs:totalDigits value="1"/&gt;
                  &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
          &lt;/xs:element&gt;
          &lt;xs:element ref="Size"/&gt;
      &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>The element Size has local scope , Can't it be reused locally?</p>
  
  <p>Edit:The above case may not make much sense.Consider the Case below , is there no way to reuse the existing definition of "Size": </p>
  
  <pre><code>&lt;xs:complexType name="Team"&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="Name" type="xs:string"/&gt;
          &lt;xs:element name="Size"&gt;
              &lt;xs:simpleType&gt;
                  &lt;xs:restriction base="xs:integer"&gt;
                      &lt;xs:totalDigits value="1"/&gt;
                  &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
          &lt;/xs:element&gt;
          &lt;xs:element name="teamLeads"&gt;
              &lt;xs:complexType&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element ref="Size"/&gt;
                  &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  </code></pre>