title: xsd:simpleType: Can xsd:pattern and xsd:maxLength work together?
body: <p>Let's say I am dealing with an xsd:simpleType that is a string, needs to be of a certain character set and of a specific maximum length, similar to the below code:  </p>
  
  <pre><code>&lt;xsd:simpleType name="MyType"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
      &lt;xsd:pattern value="[0-9]" /&gt;
      &lt;xsd:maxLength value="36" /&gt;
      &lt;/xsd:restriction&gt;
  &lt;/xsd:simpleType&gt;  
  </code></pre>
  
  <p>So my xsd type will be a string of only digits and maximum of 36 characters. My question is whether the xsd:pattern and xsd:maxLength (or any other similar tag like minLength) can work together. My intuition is no; either pattern or length-based xsd elements only in the xsd:restriction. Therefore, I would have to add the max length restriction into the pattern.  </p>
  
  <p>Please note that I did test this out by unmarshalling an xml on Java and the validation failed. Regardless, what I am looking for is information as two how and whether pattern and maxLength can work together.</p>