Fatal error compiling stylesheet that stores external document to global variable

Post here questions and problems related to editing and publishing DITA content.
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

Fatal error compiling stylesheet that stores external document to global variable

Post 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
Mircea
Posts: 134
Joined: Tue Mar 25, 2003 11:21 am

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

Post by Mircea »

Hello,

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

Regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

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

Post 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
Attachments
test_files.zip
(1.31 KiB) Downloaded 126 times
Mircea
Posts: 134
Joined: Tue Mar 25, 2003 11:21 am

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

Post by Mircea »

Hello,

The proper scenario to be used is Ant (with Saxon-HE XSLT Support), and the transformation works fine.
antWithXSLT.png
antWithXSLT.png (8.49 KiB) Viewed 807 times
Best regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

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

Post 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!
Post Reply