title: XML schema; multiple from a list of valid attribute values
body: <p>I'm reasonably new to working with XML schemas, so excuse my incompetence if this is more trivial than I myself believe it must be.</p>
  
  <p>I'm trying to create a required attribute that must contain 1 or more white-space-separated string values from a list. The list is the 4 typical HTTP request methods; <code>get</code>, <code>post</code>, <code>put</code>, and <code>delete</code>.</p>
  
  <p>So valid elements would include:</p>
  
  <pre><code>&lt;rule methods="get" /&gt;
  &lt;rule methods="get post" /&gt;
  &lt;rule methods="post put delete" /&gt;
  </code></pre>
  
  <p>Whereas invalid elements would include:</p>
  
  <pre><code>&lt;rule methods="get get" /&gt;
  &lt;rule methods="foobar post" /&gt;
  &lt;rule methods="get;post;put" /&gt;
  </code></pre>
  
  <p>I've tried fooling with enumerations and length, but I don't believe I'm understanding what I need to do (<em>or for that matter if it is in fact possible, though it seems as though it should be</em>)</p>
  
  <hr>
  
  <p>This is where I'm at now, thanks to @tdrury:</p>
  
  <pre><code>&lt;xs:attribute name="methods" use="required"&gt;
      &lt;xs:simpleType&gt;
          &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:whiteSpace value="collapse" /&gt;
              &lt;xs:pattern value="(?:(?:get|post|put|delete)\s?){1,4}" /&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  &lt;/xs:attribute&gt;
  </code></pre>
  
  <p>Which works, except for repetition (<em>such as <code>get get</code> or <code>post post post</code></em>) and absent whitespace (<em>such as <code>getpost</code> or <code>postputdelete</code></em>)</p>
  
  <hr>
  
  <p><strong>Edit</strong>:</p>
  
  <p>After playing around with this a bit, I came up with an idea: an enumeration of all possible sequences. Thankfully, this list is (<em>for the time being</em>) fixed to the four usual transport methods, <code>get</code>, <code>post</code>, <code>put</code>, and <code>delete</code>, so I figured:</p>
  
  <pre><code>&lt;xs:restriction base="xs:string"&gt;
      &lt;xs:whiteSpace value="collapse" /&gt;
      &lt;xs:enumeration value="delete" /&gt;
      &lt;xs:enumeration value="put" /&gt;
      &lt;xs:enumeration value="put delete" /&gt;
      &lt;xs:enumeration value="post" /&gt;
      &lt;xs:enumeration value="post delete" /&gt;
      &lt;xs:enumeration value="post put" /&gt;
      &lt;xs:enumeration value="post put delete" /&gt;
      &lt;xs:enumeration value="get" /&gt;
      &lt;xs:enumeration value="get delete" /&gt;
      &lt;xs:enumeration value="get put" /&gt;
      &lt;xs:enumeration value="get put delete" /&gt;
      &lt;xs:enumeration value="get post" /&gt;
      &lt;xs:enumeration value="get post delete" /&gt;
      &lt;xs:enumeration value="get post put" /&gt;
      &lt;xs:enumeration value="get post put delete" /&gt;
  &lt;/xs:restriction&gt;
  </code></pre>
  
  <p>Can anyone see a reason that this would <em>not</em> be a good idea?</p>