public static String validateAgainstXSD(final StreamSource streamSource){
  try {
    if (schema == null) {
      schema=getSchema();
    }
    final Validator validator=schema.newValidator();
    validator.validate(streamSource);
    return StringUtils.EMPTY;
  }
 catch (  Exception e) {
    LOG.warn("Error during the XML schema validation!",e);
    return e.getMessage();
  }
}

public static String validateAgainstXSD ( final StreamSource streamSource ) { try { if ( schema == null ) { schema = getSchema ( ) ; } final Validator validator = schema . newValidator ( ) ; validator . validate ( streamSource ) ; return StringUtils . EMPTY ; } catch ( Exception e ) { LOG . warn ( "Error during the XML schema validation!" , e ) ; return e . getMessage ( ) ; } }
this method allows to validate an xml against the xades xsd schema .
