ph-schematron/src/main/java/com/helger/schematron/SchematronHelper.java
@Nullable
  public static SchematronOutputType applySchematron (@Nonnull final ISchematronResource aSchematron,
                                                      @Nonnull final IReadableResource aXML)
  {
    ValueEnforcer.notNull (aSchematron, "SchematronResource");
    ValueEnforcer.notNull (aXML, "XMLSource");

    try
    {
      // Apply Schematron on XML
      return aSchematron.applySchematronValidationToSVRL (aXML);
    }
    catch (final Exception ex)
    {
      throw new IllegalArgumentException ("Failed to apply Schematron " +
                                          aSchematron.getID () +
                                          " onto XML resource " +
                                          aXML.getResourceID (),
                                          ex);
    }
  }
@Nullable
  public static SchematronOutputType applySchematron (@Nonnull final ISchematronResource aSchematron,
                                                      @Nonnull final IReadableResource aXML)
  {
    ValueEnforcer.notNull (aSchematron, "SchematronResource");
    ValueEnforcer.notNull (aXML, "XMLSource");

    try
    {
      // Apply Schematron on XML
      return aSchematron.applySchematronValidationToSVRL (aXML);
    }
    catch (final Exception ex)
    {
      throw new IllegalArgumentException ("Failed to apply Schematron " +
                                          aSchematron.getID () +
                                          " onto XML resource " +
                                          aXML.getResourceID (),
                                          ex);
    }
  }
@ Nullable public static SchematronOutputType applySchematron ( @ Nonnull final ISchematronResource aSchematron , @ Nonnull final IReadableResource aXML ) { ValueEnforcer . notNull ( aSchematron , "SchematronResource" ) ; ValueEnforcer . notNull ( aXML , "XMLSource" ) ; try { // Apply Schematron on XML return aSchematron . applySchematronValidationToSVRL ( aXML ) ; } catch ( final Exception ex ) { throw new IllegalArgumentException ( "Failed to apply Schematron " + aSchematron . getID ( ) + " onto XML resource " + aXML . getResourceID ( ) , ex ) ; } }
Apply the passed schematron on the passed XML resource using a custom error
handler.

@param aSchematron
The Schematron resource. May not be <code>null</code>.
@param aXML
The XML resource. May not be <code>null</code>.
@return <code>null</code> if either the Schematron or the XML could not be
read.
@throws IllegalStateException
if the processing throws an unexpected exception.
Apply the passed schematron on the passed XML resource using a custom error handler .