Project

Profile

Help

Using XSpec with Saxon-JS 2 instead of Saxon Java: Error FORG0006 at xpath.xsl#786

Added by Martin Honnen over 3 years ago

I have attempted to check whether I can run the XSpec stylesheets with Saxon-JS 2.3 instead of Saxon Java.

So I installed the release 2.1.4 of XSpec (https://github.com/xspec/xspec/releases/tag/v2.1.4) into a directory and then tried to compile the "src\compiler\compile-xslt-tests.xsl" sheet:

C:\Program Files\XSpec\xspec-2.1.4>xslt3 -t -nogo -xsl:src\compiler\compile-xslt-tests.xsl -export:src\compiler\compile-xslt-tests.xsl.sef.json
Saxon-JS 2.3 from Saxonica
Node.js version v14.16.0
Compiling stylesheet C:\Program Files\XSpec\xspec-2.1.4\src\compiler\compile-xslt-tests.xsl
Failed to compile stylesheet: Effective boolean value is not defined for maps
Error FORG0006 at xpath.xsl#786
    Failed to compile stylesheet:
Error FORG0006 at xpath.xsl#786
    Effective boolean value is not defined for maps

I suppose xpath.xsl is part of Saxon-JS? Saxon EE Java 10.5 compiles the file fine.


Replies (1)

RE: Using XSpec with Saxon-JS 2 instead of Saxon Java: Error FORG0006 at xpath.xsl#786 - Added by Martin Honnen over 3 years ago

I went further to try to run the different processing steps of XSpec through Saxon-JS 2.3 and run into a problem with includes being sought in the wrong directory of where Saxon Java looks:

C:\Program Files\XSpec\xspec-2.1.4>xslt3 -t -nogo -xsl:tutorial\xspec\escape-for-regex-compiled-saxon-js23.xsl -export:tutorial\xspec\escape-for-regex-compiled-saxon-js23.xsl.sef.json
Saxon-JS 2.3 from Saxonica
Node.js version v14.16.0
Compiling stylesheet C:\Program Files\XSpec\xspec-2.1.4\tutorial\xspec\escape-for-regex-compiled-saxon-js23.xsl
Failed to compile stylesheet: Error XTSE0165 at xsl:include/@href on line 4 in xspec/escape-for-regex-compiled-saxon-js23.xsl:
 xsl:include of  file:///c:/Program%20Files/XSpec/xspec-2.1.4/common/runtime-utils.xsl failed:Cannot read file file:///c:/Program%20Files/XSpec/xspec-2.1.4/common/runtime-utils.xsl - ENOENT: no such file or directory, open 'c:\Program Files\XSpec\xspec-2.1.4\common\runtime-utils.xsl'
Error Q{http://www.w3.org/2005/xqt-errors}XTSE0165 at static.xsl#221
    Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTSE0165 at static.xsl#221
    Error XTSE0165 at xsl:include/@href on line 4 in xspec/escape-for-regex-compiled-saxon-js23.xsl:
 xsl:include of  file:///c:/Program%20Files/XSpec/xspec-2.1.4/common/runtime-utils.xsl failed:Cannot read file file:///c:/Program%20Files/XSpec/xspec-2.1.4/common/runtime-utils.xsl - ENOENT: no such file or directory, open 'c:\Program Files\XSpec\xspec-2.1.4\common\runtime-utils.xsl'

Saxon-Java creates an import for <xsl:include href="file:/C:/Program%20Files/XSpec/xspec-2.1.4/src/common/runtime-utils.xsl"/> and finds it while Saxon-JS 2.3 creates an import xsl:include href="file:///c:/Program%20Files/XSpec/xspec-2.1.4/common/runtime-utils.xsl"/> it then can't find obviously.

Compilation was done with C:\Program Files\XSpec\xspec-2.1.4>xslt3 -t -s:tutorial\escape-for-regex.xspec -xsl:src\compiler\compile-xslt-tests.xsl.ee.sef.json -o:tutorial\xspec\escape-for-regex-compiled-saxon-js23.xsl.

I am not quite sure, at this stage, whether the difference is in XSLT/XPath base or document-uri evaluation or my failure to properly set up environment variables used by XSpec for the stylesheets when I try to run stuff through Saxon-JS.

XSpec in src\compiler\xslt\main.xsl does

        <xsl:for-each
            select="
               '../../common/runtime-utils.xsl',
               '../../schematron/select-node.xsl'[$is-schematron]">
            <xsl:element name="xsl:include" namespace="{$x:xsl-namespace}">
               <xsl:attribute name="href" select="resolve-uri(.)" />
            </xsl:element>
         </xsl:for-each>

to generate the xsl:include. So perhaps resolve-uri(.) is the culprit.

    (1-1/1)

    Please register to reply