title: Restricting string length in XML Schema
body: <p>I am new to XML and JAXB, I am trying to add the AdditionalDataDeposit field with restrictions to my XML schema so I can generate the POJO with Maven. When I try to build it in maven the error: </p>
  
  <pre><code>blahBlahBlahmsgfactory: Unable to parse input schema(s). Error messages should have been provided. 
  org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 
  'LimitedString50' to a(n) 'type definition' component.
  </code></pre>
  
  <p>my code:</p>
  
  <p>Under AdditionalData complex type:</p>
  
  <pre><code>&lt;xs:element name="DEPOSIT" type="trmns:AdditionalDataDEPOSIT" minOccurs="0"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;Additional Deposit Data&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>  &lt;xs:complexType name="AdditionalDataDEPOSIT"&gt;
      &lt;xs:annotation&gt;
        &lt;xs:documentation&gt;Additional Deposit Data&lt;/xs:documentation&gt;
      &lt;/xs:annotation&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="depositorID" type="LimitedString50"/&gt;
        &lt;xs:element name="depositorNationality" type="LimitedString50"/&gt;
        &lt;xs:element name="fundSource" type="LimitedString50"/&gt;
        &lt;xs:element name="fullName" type="LimitedString100"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;xs:simpleType name="LimitedString50"&gt;
      &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="50" /&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    &lt;xs:simpleType name="LimitedString100"&gt;
      &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="100" /&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>I dont understand much of XML Schema's, but advice will be appreciated.</p>