Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator fails on xslt compiled by schxslt 1.9.x and saxon-he 11.3 #98

Closed
rkottmann opened this issue Jul 8, 2022 · 5 comments
Closed
Labels
Milestone

Comments

@rkottmann
Copy link
Member

Hi,

I am developing a new validator configuration at https://projekte.kosit.org/eforms/validator-configuration-eforms

There, I use schxslt and Saxon-He in newest versions (see pom.xml). When I try to run the validator with the compiled XSLT using the following ant snippet (see build.xml):

 <java jar="${lib.dir}/${validator.artifact.name}" failonerror="true" fork="true" dir="${build.dir}">
            <arg value="-l" />
            <arg value="debug" />
            <arg value="-s" />
            <arg value="scenarios.xml" />
            <arg value="-r" />
            <arg value="${build.dir}" />
            <!--<arg value="-\-html" />-->
            <arg value="-o" />
            <arg value="${reports.dir}/eforms-sdk-examples" />
            <arg value="${eforms-sdk.instances.dir}" />
        </java>

I get the following Error:

validator-reports-from-eforms-sdk-examples:
     [echo] Creating validation reports with /home/renzo/projects/validator-configuration-eforms/lib/validationtool-1.4.2-standalone.jar for /home/renzo/projects/validator-configuration-eforms/build/test/eforms-sdk-examples.
     [java] 2022-07-09 00:56:54 [INFO] Using resolving strategy STRICT_RELATIVE
     [java] KoSIT Validator version 1.4.2
     [java] Loading scenarios from  file:///home/renzo/projects/validator-configuration-eforms/build/scenarios.xml
     [java] Using repository  file:///home/renzo/projects/validator-configuration-eforms/build/
     [java] 2022-07-09 00:56:55 [DEBUG] Try to disable extern DTD access
     [java] 2022-07-09 00:56:55 [INFO] Load schema from source file:/home/renzo/projects/validator-configuration-eforms/lib/validationtool-1.4.2-standalone.jar!/xsd/scenarios.xsd
     [java] 2022-07-09 00:56:55 [INFO] Loading scenarios from file:///home/renzo/projects/validator-configuration-eforms/build/scenarios.xml
     [java] WARNING: An illegal reflective access operation has occurred
     [java] WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/home/renzo/projects/validator-configuration-eforms/lib/validationtool-1.4.2-standalone.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
     [java] WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
     [java] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
     [java] WARNING: All illegal access operations will be denied in a future release
     [java] 2022-07-09 00:56:56 [INFO] Loading scenario content from file:///home/renzo/projects/validator-configuration-eforms/build/
     [java] 2022-07-09 00:56:57 [INFO] Loading XSLT script from  resources/eforms-sdk/eforms-sdk-schematron-validator.xsl
     [java] 2022-07-09 00:57:25 [ERROR] Inline functions require support for higher-order-functions, which needs Saxon-PE or higher At row 38 at pos 0
     [java] Can not compile xslt executable for uri resources/eforms-sdk/eforms-sdk-schematron-validator.xsl
     [java] 2022-07-09 00:57:25 [ERROR] Can not compile xslt executable for uri resources/eforms-sdk/eforms-sdk-schematron-validator.xsl
     [java]
     [java] ##############################
     [java] #     Validation failed!     #
     [java] ##############################

May a newer Saxon He Version help?

[java] 2022-07-09 00:57:25 [ERROR] Inline functions require support for higher-order-functions, which needs Saxon-PE or higher At row 38 at pos 0

@rkottmann rkottmann added the bug label Jul 8, 2022
@apenski
Copy link
Collaborator

apenski commented Jul 10, 2022

well, if the compiled schematron contains higher-order-functions this won't work with the included Saxon HE and I don't think upgrading would solve this.

If schxslt generates this kind of xsl instruction which is not supported by saxon HE, I would consider this as a bug or at least optimization potential of schxslt.

@rkottmann
Copy link
Member Author

rkottmann commented Jul 11, 2022

Upgrading works. I am not into all changelogs of Saxon, but it has to do with XSLT3 etc. support and might work with versions > 10.

However it surely works with 11.3.

I tested it with this snippet:

<target name="eforms-sdk-examples-validated-with-schxslt" depends="compile-test">
        
        <xslt in="${eforms-sdk.instances.dir}/CEI.xml" style="${eforms-sdk.schematron.validator}" destdir="${reports.dir}" out="${reports.dir}/cei.svrl">
            <classpath  >
                <pathelement location="${lib.dir}/${saxon-he.artifact.name}"/>
                <pathelement location="${lib.dir}/xmlresolver-4.2.0.jar"/>
            </classpath>
            <factory name="net.sf.saxon.TransformerFactoryImpl" />
<!--            <fileset dir="${eforms-sdk.instances.dir}"/>-->
        </xslt>
        
    </target>

which I just pushed to https://projekte.kosit.org/eforms/validator-configuration-eforms

In any case, I suggest to upgrade all pom dependencies or at least Saxon to newest versions. It is also advisable to switch to schxslt based Schematron validation, because the ISO based one is officially deprecated in favor of schxslt.

In my special case, I need it urgently, cause I have to deliver the validator-configuration-eforms by mid of July.

@phax
Copy link

phax commented Sep 2, 2022

The validator uses the Saxon HE version 9.9.1-7, the latest production version is 11.4 - this is a major difference....

@apenski apenski added this to the 1.5.0 milestone Nov 8, 2022
@apenski
Copy link
Collaborator

apenski commented Nov 8, 2022

We will upgrade to a recent saxon version with the next release targeted for december

@apenski
Copy link
Collaborator

apenski commented Dec 2, 2022

upgraded to 11.4 in main

@apenski apenski closed this as completed Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants