Is there a way using XSLT Packages in Schematron

Are you missing a feature? Request its implementation here.
nkutsche
Posts: 8
Joined: Wed Feb 25, 2015 5:10 pm

Is there a way using XSLT Packages in Schematron

Post by nkutsche »

Hi,

I'm working more and more with XSLT packages. Now I have a first case where I would like to reuse one in a Schematron schema.

Is there a way to do this? In Schematron it would look like this:

Code: Select all

<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    queryBinding="xslt3">
    <xsl:use-package package-version="*" name="http://www.nkutsche.com/my-special-xslt-module"/>
A standard Schematron implementation should be able to handle this. As far as I can see the only thing to do for the environment would be to enable a custom Saxon config for Schematron validations or a custom Saxon initializer class to provide the package resources. I haven't found a way to do this in Oxygen 26. Have I missed something?

Best Regards,
Nico
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Is there a way using XSLT Packages in Schematron

Post by tavy »

Hi Nico,

Thanks for the feedback,
Unfortunately, we do not support XSLT packages in Schematron. I added an issue on our issue tracker to implement this support in a future version

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
nkutsche
Posts: 8
Joined: Wed Feb 25, 2015 5:10 pm

Re: Is there a way using XSLT Packages in Schematron

Post by nkutsche »

Hi Octavian,
thanks for the response! Meanwhile I found a workaround which meets maybe not all needs of the package subject, but for my planned show case it works.
You can use the transform function of XSLT 3. Saxon allows to provide a custom Saxon config file via the vendor-options field:
See https://www.saxonica.com/html/documenta ... sform.html

My solution looks like this now:

Code: Select all

<sch:let name="config" value="doc('saxon-config.xml')"/>
<sch:let name="xmlml-function" value="
        function($name as xs:string, $args as array(*)){
            transform(map{ 
                    'vendor-options': map {QName('http://saxon.sf.net/', 'configuration'): $config},
                    'package-name' : 'http://www.nkutsche.com/xmlml',
                    'initial-function' : QName($xmlmlns, $name),
                    'function-params' : $args,
                    'delivery-format' : 'raw',
                    'package-version' : '*'
                })?output
            }
        "/>
<sch:let name="xmlml-doc" value="$xmlml-function('parse', [base-uri(/)])"/>
Best Regards,
Nico
Post Reply