title: Add attributes to a simpletype or restriction to a complextype in Xml Schema
body: <p>The problem is as follows:</p>
  
  <p>I have the following XML snippet:</p>
  
  <pre><code>&lt;time format="minutes"&gt;11:60&lt;/time&gt;
  </code></pre>
  
  <p>The problem is that I can't add both the attribute and the restriction at the same time. The attribute format can only have the values minutes, hours and seconds. The time has the restriction pattern <code>\d{2}:\d{2}</code></p>
  
  <pre><code>&lt;xs:element name="time" type="timeType"/&gt;
  ...
  &lt;xs:simpleType name="formatType"&gt;
      &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="minutes"/&gt;
          &lt;xs:enumeration value="hours"/&gt;
          &lt;xs:enumeration value="seconds"/&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:complexType name="timeType"&gt;
      &lt;xs:attribute name="format"&gt;
          &lt;xs:simpleType&gt;
              &lt;xs:restriction base="formatType"/&gt;
          &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>If I make a complex type of timeType, I can add an attribute, but not the restriction, and if I make a simple type, I can add the restriction but not the attribute. Is there any way to get around this problem. This is not a very strange restriction, or is it?</p>