title: XSD Restriction on Attribute
body: <p>I think I have searched a lot about this but still no go.</p>
  
  <p>Will appreciate any help.</p>
  
  <p>I am trying to restrict an attribute for an element with empty content. "color" should have a restriction to only hold 3 digit or minLength=3 and maxLength=3. It should not have any content.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation=""&gt;
    &lt;product id="" name=""&gt;
      &lt;article id="1001"&gt;
        &lt;umbrella color="100"/&gt;
        &lt;umbrella color="101"/&gt;
      &lt;/article&gt;
      &lt;article id="1002"&gt;
        &lt;umbrella color="110"/&gt;
      &lt;/article&gt;
    &lt;/product&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>EDIT: I know how to do a XSD Restriction on a simpleType. But I don't how to combine it to one entity with a ComplexType.</p>
  
  <p>If you could provide a more detailed (or full) solution I would be happy.</p>
  
  <p>Btw, "color" is not limited to xs:integer. It is actually a xs:string.</p>