saxon:evaluate in XQuery script

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Naoki Hirai
Posts: 2
Joined: Fri Mar 01, 2024 10:31 am

saxon:evaluate in XQuery script

Post by Naoki Hirai »

I'm migrating custom refactoring scripts written with XQuery. Those scripts were developed for Oxygen V20.1 and work fine. When I copied those scripts to the 'refactoring' folder of Oxygen V26.1 and executed one of them. Then, I got following error message:
Cannot find a 1-argument function named Q{http://saxon.sf.net/}evaluate()
I looked into the refactoring scripts bundled with V26.1. As a result, the XPath evaluation statement was modified as follows:
V20.1

Code: Select all

let $elements := saxon:evaluate($element_xpath)
V26.1

Code: Select all

let $elements := local:eval($element_xpath, (./*)[1])
Does this mean XPath evaluation method was changed due to a particular reason?
Could you please provide me with information regarding this matter?

Thank you inadvance,
Naoki
Radu
Posts: 9154
Joined: Fri Jul 09, 2004 5:18 pm

Re: saxon:evaluate in XQuery script

Post by Radu »

Hi Naoki,
The XQuery scripts are evaluated using the Saxon libraries. At some point we upgraded the Saxon library in Oxygen to version 12.3 and Saxon's developers have decided to remove completely the support for saxon:evaluate. This means we had to adapt our scripts with their own inline implementation of "local:eval" that you already noticed. So I advice you to do the same for your scripts or switch to using XSLT 3.0 which has an <xsl:evaluate> instruction.
In the future from what I've seen Saxon plans to bring back saxon:eval in order to remove this inconvenience so it might be possible a future version of Oxygen will be able to use saxon:eval directly again in the refactoring scripts.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply