code: public boolean checkSchematronRules(Document doc, String schemaFile,
              String phase) throws Exception {
  
          boolean isValid = false;
  
          if (doc == null || doc.getDocumentElement() == null)
              return isValid;
          try {
              ClassLoader loader = this.getClass().getClassLoader();
              URL url = loader.getResource(schemaFile);
              this.schemaFile = new File(
                      URLDecoder.decode(url.getFile(), "UTF-8"));
          } catch (Exception e) {
              assert false : "Entity body not found. " + e.toString();
          }
          this.phase = phase;
          Document returnDoc = parse(doc, null, null);
          if (returnDoc != null) {
              isValid = true;
          }
          return isValid;
      }
docs: Checks the given schematron phase for the XML file and returns the
  validation status.
  
  @param doc
  The XML file to validate (Document)
  @param schemaFile
  The string path to the schematron file to use
  @param phase
  The string phase name (contained in schematron file)
  @return Whether there were validation errors or not (boolean)