title: XML Schema How to Restrict Attribute by Enumeration
body: <p>I have the following XML Tag</p>
  
  <pre><code>&lt;price currency="euros"&gt;20000.00&lt;/price&gt;
  </code></pre>
  
  <p>How do I restrict the currency attribute to one the following:</p>
  
  <ul>
  <li>euros</li>
  <li>pounds</li>
  <li>dollars</li>
  </ul>
  
  <p>AND the price to a double?</p>
  
  <p>I just get an error when I try to a type on both, here's what I've got so far:</p>
  
  <pre><code>&lt;xs:element name="price"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:attribute name="currency"&gt;
              &lt;xs:simpleType&gt;
                  &lt;xs:restriction base="xs:string"&gt;
                      &lt;xs:enumeration value="pounds" /&gt;
                      &lt;xs:enumeration value="euros" /&gt;
                      &lt;xs:enumeration value="dollars" /&gt;
                  &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
          &lt;/xs:attribute&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>