Page 1 of 1

Fatal error compiling stylesheet that stores external document to global variable

Posted: Mon Aug 22, 2022 12:09 am
by rjcbop
We have an ANT-based transformation scenario with a stylesheet that reads in an external XML document and stores the contents to a global variable, which is then used in transforming a source DITA file. The job runs fine in Oxygen 23.1 but fails with the following error in Oxygen 24.1:

Error checking type of the expression 'FilterParentPath(variable-ref(raw_items/result-tree), step("descendant-or-self", 1))'

Here's the part of our stylesheet that defines and references the global variable 'raw_items':

<xsl:variable name="raw_items">
<xsl:copy-of select="document($source_xml_file)"/>
</xsl:variable>

<xsl:variable name="all_items">
<xsl:for-each select="$raw_items//item">

Thanks for any suggestions regarding this issue

Re: Fatal error compiling stylesheet that stores external document to global variable

Posted: Tue Aug 23, 2022 9:57 am
by Mircea
Hello,

In order to help you we need a small sample that we can use for tests.

Regards,
Mircea.

Re: Fatal error compiling stylesheet that stores external document to global variable

Posted: Fri Aug 26, 2022 6:54 pm
by rjcbop
I've attached a zip file containing the following set of test files that will hopefully allow you to reproduce the issue:

test.xsl - stylesheet for transforming a source DITA file
test_build.xml - ANT build file
test_in.dita - source DITA file to be transformed
test_items.xml - auxilliary file to use in the transformation

For simplicity, the stylesheet, source DITA file and auxilliary XML file are assumed to be at the root of the directory containing the ANT build file. We're using a standard ANT transformation scenario but with the following additional JVM argument: -Dxml.catalog.files=${xmlCatalogFilesList}

Thanks very much for testing this out

Re: Fatal error compiling stylesheet that stores external document to global variable

Posted: Mon Aug 29, 2022 3:17 pm
by Mircea
Hello,

The proper scenario to be used is Ant (with Saxon-HE XSLT Support), and the transformation works fine.
antWithXSLT.png
Best regards,
Mircea.

Re: Fatal error compiling stylesheet that stores external document to global variable

Posted: Tue Aug 30, 2022 5:26 pm
by rjcbop
We were actually using the Ant (with Saxon-HE XSLT support) transformation scenario, but we had initially created this in 23.1. When we upgraded to 24.1, we did not manually update our customized version of that transformation scenario so that it was based on the 24.1 version of the Ant (with Saxon-HE XSLT support) transformation scenario. We see that there are differences in the libraries in the 23.1 and 24.1 versions of that build-in scenario and that's obviously where the problem was. Thanks for testing this out!