schematron
schematron copied to clipboard
Pass xsl:include in Schematron through to the compiled stylesheet
This change allows using xsl:include in a Schematron to include an XSLT file. This currently works in oXygen 19.1 but does not work in the Schematron Skeleton XSLTs. A use case for this is to import an XSLT that contains a library of custom functions. It is currently possible to include xsl:function definitions in a Schematron though only in the main Schematron file, so this change allows for better organization and reusability.
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<sch:ns uri="function-library" prefix="lib"/>
<xsl:include href="function-library.xsl"/>
<sch:pattern>
<sch:rule context="example">
<sch:assert test="lib:check(.)">custom function check</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>
The new sch:extends[@href] element might accomplish the same goal. I will have to try this possibly better alternative.