title: How to get internalization with validation messages of SAX XML Schema Validator?
body: <p>I'm using this code to validate a XML against a XSD:</p>
  
  <pre><code>SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
  Schema schema = factory.newSchema(xmlSchema);
  Validator validator = schema.newValidator();
  Source source = new StreamSource(myXmlFile);
  
  try {
      validator.validate(source);
      return null;
  }catch (SAXException ex) {
      String validationMessage = ex.getMessage();
      return validationMessage;
  }
  </code></pre>
  
  <p>But when the XML is not valid, the message is always something like this:</p>
  
  <pre><code>cvc-minLength-valid: Value '-' with length = '1' is not facet-valid with respect to minLength '2' for type '#AnonType_xLgrTEndereco'.
  </code></pre>
  
  <p>Is there a way to return a user friendly message in my language, without having to translate the message programatically?</p>
  
  <p><strong>UPDATE</strong>
  This is piece of code in the XSD for the field in which the message occured:</p>
  
  <pre><code>&lt;xs:element name="xLgr"&gt;
      &lt;xs:annotation&gt;
          &lt;xs:documentation&gt;Logradouro&lt;/xs:documentation&gt;
      &lt;/xs:annotation&gt;
      &lt;xs:simpleType&gt;
          &lt;xs:restriction base="TString"&gt;
              &lt;xs:maxLength value="60"/&gt;
              &lt;xs:minLength value="2"/&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>As you can see it even has a description to return the "name" of the field (Logradouro) but the schema validator seems not to recognize it.</p>