title: Using xs:extension & xs:restriction together?
body: <p>While writing an XML schema, I am attempting to do something like this</p>
  
  <pre><code>&lt;xs:complexType name="ValueWithUnits"&gt;
      &lt;xs:simpleContent&gt;
          &lt;xs:extension base="xs:double"&gt;
              &lt;xs:attribute name="uom" fixed="second"/&gt;
              &lt;xs:minInclusive="0"/&gt;
              &lt;xs:maxInclusive="10"/&gt;
          &lt;/xs:extension&gt;
      &lt;/xs:simpleContent&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>Unfortunately, xs:attribute is allowed on xs:extension while xs:minInclusive &amp; xs:maxInclusive are allowed on xs:restriction, but not together.</p>
  
  <p>What is the best way to structure this? Do I have to define an extension with the appropriate units &amp; then restrict it with my min &amp; max values?</p>