Class SchematronProviderXSLTFromSCH

java.lang.Object
com.helger.schematron.sch.SchematronProviderXSLTFromSCH
All Implemented Interfaces:
com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider

@NotThreadSafe public class SchematronProviderXSLTFromSCH extends Object implements com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
The XSLT preprocessor used to convert a Schematron XML document into an XSLT document. This implementation uses JAXP with Saxon to be used as the respective parser.
Author:
Philip Helger
  • Field Details

    • SCHEMATRON_DIRECTORY_XSLT2

      public static final String SCHEMATRON_DIRECTORY_XSLT2
      The classpath directory where the Schematron 2 XSLT files reside.
      See Also:
    • XSLT2_STEP1

      public static final String XSLT2_STEP1
      The class path to first XSLT to be applied.
      See Also:
    • XSLT2_STEP2

      public static final String XSLT2_STEP2
      The class path to second XSLT to be applied.
      See Also:
    • XSLT2_STEP3

      public static final String XSLT2_STEP3
      The class path to third and last XSLT to be applied.
      See Also:
  • Constructor Details

    • SchematronProviderXSLTFromSCH

      protected SchematronProviderXSLTFromSCH(@Nonnull com.helger.commons.io.resource.IReadableResource aSchematronResource, @Nonnull TransformerCustomizerSCH aTransformerCustomizer)
      Constructor.
      Parameters:
      aSchematronResource - SCH resource. May not be null.
      aTransformerCustomizer - The customizer for XSLT Transformer objects. May not be null.
      Throws:
      com.helger.schematron.SchematronInterruptedException - if Schematron validation was interrupted
  • Method Details

    • cacheXSLTTemplates

      public static void cacheXSLTTemplates()
      Ensure that all XSLT templates for converting Schematron to XSLT are cached. That may be called on application startup, otherwise it is done lazily on demand.
    • createSchematronXSLT

      @Nonnull public static Document createSchematronXSLT(@Nonnull com.helger.commons.io.resource.IReadableResource aSchematronResource, @Nonnull TransformerCustomizerSCH aTransformerCustomizer) throws TransformerException
      Throws:
      TransformerException
    • convertSchematronToXSLT

      public void convertSchematronToXSLT()
      This call does the main Schematron to XSLT conversion. This method may only be called once per instance.
    • getSchematronResource

      @Nonnull public final com.helger.commons.io.resource.IReadableResource getSchematronResource()
    • isValidSchematron

      public boolean isValidSchematron()
      Specified by:
      isValidSchematron in interface com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
    • getXSLTDocument

      @Nullable public final Document getXSLTDocument()
      Specified by:
      getXSLTDocument in interface com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
    • getXSLTTransformer

      @Nullable public Transformer getXSLTTransformer() throws TransformerConfigurationException
      Specified by:
      getXSLTTransformer in interface com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
      Throws:
      TransformerConfigurationException