Page 1 of 1

xsl:include/@href sometimes incorrect in output of schematronDispatcher.xsl

Posted: Wed May 02, 2018 1:00 am
by dcramer
This is an edge case, but I thought I'd mention it:

When I run frameworks/schematron/impl/schematronDispatcher.xsl against a schematron file that contains xsl:include elements, relative paths in the href attributes on the xsl:include elements are only correct if the result document happens to be in the same directory as the original schematron.

For example, say I have the following schematron that uses sch:extends. In the schematron that we're extending, there are xsl:include elements with paths that are relative to cals.sch. In the result of schematronDispatcher.xsl, the xsl:include/@href values will not be correct because they are copied verbatim from cals.sch:

Code: Select all


<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding="xslt2"
xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
<xsl:include href="../xsl/transclusion-fixup.xsl"/>

<sch:extends href="../third-party-tools/cals-table-schematron/source/cals.sch"/>

<!-- Other stuff -->

</sch:schema>

Re: xsl:include/@href sometimes incorrect in output of schematronDispatcher.xsl

Posted: Wed May 02, 2018 11:42 am
by tavy
Hello,

Thanks for the feedback.
The "schematronDispatcher.xsl" is used resolve the Schematron "sch:include" and "sch:extends". The "xsl:include" it is copied in the complied file verbatim with the rest of the XSLT code from Schematron. Adding "xsl:include" in the Schematron file is not something that is in the Schematron specification. It works because oXygen implementation is XSLT-based.

Best Regards,
Octavian