The ISO Schematron standard has been out for two years now, but I\'m still unable to find a Java implementation using ISO Schematron XSLT files (as opposed to files from an
Additionally you may use ph-schematron
which provides both support for conversion to XSLT as well as a native plain Java validation, which is quicker than the XSLT version in nearly all cases.
See https://github.com/phax/ph-schematron/ for the details as well as a quick intro.
Example code to check if an XML file matches a Schematron file:
public static boolean validateXMLViaPureSchematron (File aSchematronFile, File aXMLFile) throws Exception {
final ISchematronResource aResPure = SchematronResourcePure.fromFile (aSchematronFile);
if (!aResPure.isValidSchematron ())
throw new IllegalArgumentException ("Invalid Schematron!");
return aResPure.getSchematronValidity(new StreamSource(aXMLFile)).isValid ();
}