Package com.helger.schematron.sch
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe classpath directory where the Schematron 2 XSLT files reside.static final StringThe class path to first XSLT to be applied.static final StringThe class path to second XSLT to be applied.static final StringThe class path to third and last XSLT to be applied. -
Constructor Summary
ConstructorsConstructorDescriptionSchematronProviderXSLTFromSCH(com.helger.commons.io.resource.IReadableResource aSchematronResource, TransformerCustomizerSCH aTransformerCustomizer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEnsure that all XSLT templates for converting Schematron to XSLT are cached.static DocumentcreateSchematronXSLT(com.helger.commons.io.resource.IReadableResource aSchematronResource, TransformerCustomizerSCH aTransformerCustomizer) final com.helger.commons.io.resource.IReadableResourcefinal Documentboolean
-
Field Details
-
SCHEMATRON_DIRECTORY_XSLT2
The classpath directory where the Schematron 2 XSLT files reside.- See Also:
-
XSLT2_STEP1
The class path to first XSLT to be applied.- See Also:
-
XSLT2_STEP2
The class path to second XSLT to be applied.- See Also:
-
XSLT2_STEP3
The class path to third and last XSLT to be applied.- See Also:
-
-
Constructor Details
-
SchematronProviderXSLTFromSCH
public SchematronProviderXSLTFromSCH(@Nonnull com.helger.commons.io.resource.IReadableResource aSchematronResource, @Nonnull TransformerCustomizerSCH aTransformerCustomizer) Constructor. This call does the main Schematron to XSLT conversion.
TODO remove this from the constructor.- Parameters:
aSchematronResource- SCH resourceaTransformerCustomizer- The customizer for XSLTTransformerobjects. May not benull.- 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
-
getSchematronResource
-
isValidSchematron
public boolean isValidSchematron()- Specified by:
isValidSchematronin interfacecom.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
-
getXSLTDocument
- Specified by:
getXSLTDocumentin interfacecom.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
-
getXSLTTransformer
- Specified by:
getXSLTTransformerin interfacecom.helger.schematron.api.xslt.ISchematronXSLTBasedProvider- Throws:
TransformerConfigurationException
-