title: XML-Schema: how to set enumerations to one appearance per document
body: <p>I want to add a name-attribute to all my elements. To make sure that only some attribute values are allowed I created a restriction-pattern. Is there a way to make sure, that each enumeration value is used exactly once per document?</p>
  
  <p>simpleStyle:</p>
  
  <pre><code>&lt;xsd:simpleType name="myname"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
          &lt;xsd:enumeration value="1"/&gt;
          &lt;xsd:enumeration value="2"/&gt;
      &lt;/xsd:restriction&gt;
  &lt;/xsd:simpleType&gt;
  </code></pre>
  
  <hr>
  
  <p>XML</p>
  
  <pre><code>&lt;element  name="1"/&gt;
  &lt;element  name="2"/&gt;
  &lt;element  name="1"/&gt;
  </code></pre>
  
  <p>The last one should not be allowed.</p>
  
  <p>Is that even possible?</p>