title: Xsd Element SimpleType plus attributes
body: <p>I'm not able figure out how to express the following with Xsd:  an elment with a simpleType restriction (enumeration of values) and require an attribute on this element.  For example:</p>
  
  <pre><code>&lt;myElement some_id_value="1"&gt;Apples&lt;/myElement&gt;
  </code></pre>
  
  <p>Where the simple type is defined as:</p>
  
  <pre><code>&lt;xs:simpleType name="simpleType_Fruit"&gt;
    &lt;xs:restriction base="xs:string"&gt;
      &lt;xs:enumeration value="Apples" /&gt;
      &lt;xs:enumeration value="Bananas" /&gt;
      &lt;xs:enumeration value="Oranges" /&gt;
    &lt;/xs:restriction&gt;  
  &lt;/xs:simplType&gt;
  </code></pre>
  
  <p>My element right now is defined as:</p>
  
  <pre><code>&lt;xs:element name="myElement" type="simpleType_Fruit"/&gt;
  </code></pre>
  
  <p>A similar question asked here, and may be answered, but I'm not sure (there is only a single plus vote on the answer)</p>
  
  <p><a href="https://stackoverflow.com/questions/8501094/xsd-how-to-derive-a-simpletype-both-to-add-a-attribute-to-it-and-to-restrict-th">XSD: How to derive a simpletype both to add a attribute to it and to restrict the acceptable value of it</a></p>