Class SchematronTransformer
java.lang.Object
org.projecthusky.validation.service.schematron.SchematronTransformer
A transformer from Schematron files (
.sch
) to XML Stylesheet Transform files (.xsl
). Schematron
validators usually need the transformed XSLT files to execute them against the file to test.
The underlying XML Transformer
is not thread safe.
- Author:
- Quentin Ligier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convertToXslt
(byte[] schematronContent) Transforms a Schematron content to a 'compiled' XSLT content.void
convertToXslt
(com.helger.commons.io.resource.IReadableResource readableResource, Writer outputWriter) Transforms a Schematron resource and writes it to an outputWriter
.byte[]
convertToXslt
(File schematronFile) Transforms a Schematron file to a 'compiled' XSLT content.void
convertToXslt
(File schematronFile, File xsltFile) Transforms a Schematron file to a 'compiled' XSLT file.
-
Constructor Details
-
SchematronTransformer
Constructor.- Throws:
TransformerConfigurationException
- if it is not possible to create aTransformer
instance.
-
-
Method Details
-
convertToXslt
public void convertToXslt(File schematronFile, File xsltFile) throws TransformerException, IOException Transforms a Schematron file to a 'compiled' XSLT file.- Parameters:
schematronFile
- The source Schematron (.sch
) file.xsltFile
- The destination XSLT (.xsl
) file.- Throws:
TransformerException
- if the XML transformation fails.IOException
-
convertToXslt
Transforms a Schematron content to a 'compiled' XSLT content.- Parameters:
schematronContent
- The source Schematron (.sch
) content.- Returns:
- the content of the transformed XSLT.
- Throws:
TransformerException
- if the XML transformation fails.
-
convertToXslt
Transforms a Schematron file to a 'compiled' XSLT content.- Parameters:
schematronFile
- The source Schematron (.sch
) file.- Returns:
- the content of the transformed XSLT.
- Throws:
TransformerException
- if the XML transformation fails.
-
convertToXslt
public void convertToXslt(com.helger.commons.io.resource.IReadableResource readableResource, Writer outputWriter) throws TransformerException Transforms a Schematron resource and writes it to an outputWriter
.- Parameters:
readableResource
- The Schematron resource to transform.outputWriter
- The output writer.- Throws:
TransformerException
- if the XML transformation fails.
-