简体   繁体   English

更新到oXygen 17.1后从命令行调用XQuery Update

[英]calling XQuery Update from the command line after update to oXygen 17.1

We have for the past year been running a batch script I wrote to call a series of XQuery Updates from the Windows command line using Saxon. 在过去的一年中,我们一直在运行一个批处理脚本,我编写该批处理脚本是使用Saxon从Windows命令行调用一系列XQuery Updates。 It worked fine while we were on oXygen 16, but after all the machines in our department were upgraded to oXygen 17.1, the script is now throwing an error that I can't seem to fix. 在使用oXygen 16时,它工作正常,但是在我们部门的所有机器都升级到oXygen 17.1之后,脚本现在抛出了我似乎无法修复的错误。 Any thoughts would be greatly appreciated. 任何想法将不胜感激。

This used to work when oXygen 16 was installed: 这在安装oXygen 16时起作用:

java -cp "C:\Program Files\Oxygen XML Editor 16\lib\saxon9ee.jar" net.sf.saxon.Query -update:on -t -q:"C:\Users\%USERNAME%\Documents\SVN Working Copies\trunk\rbscXSL\Locations2015\AbID2dsc-items.xq"

I have confirmed that the .jar file is in the same relative location (with the oXygen version number being the only change to the path) and has the same name as before. 我已经确认.jar文件位于相同的相对位置(oXygen版本号是对路径的唯一更改),并且具有与以前相同的名称。 Nevertheless, after updating the class path to "C:\\Program Files\\Oxygen XML Editor 17\\lib\\saxon9ee.jar" the script throws the following error: 不过,在将类路径更新为“ C:\\ Program Files \\ Oxygen XML Editor 17 \\ lib \\ saxon9ee.jar”之后,脚本将引发以下错误:

Saxon-EE 9.6.0.7J from Saxonica 来自Saxonica的Saxon-EE 9.6.0.7J

Java version 1.8.0_92 Java版本1.8.0_92

java.lang.UnsupportedOperationException: XQuery Update is not supported in this Saxon Configuration java.lang.UnsupportedOperationException:此Saxon配置中不支持XQuery Update

at net.sf.saxon.s9api.XQueryCompiler.setUpdatingEnabled(XQueryCompiler.java:212) 在net.sf.saxon.s9api.XQueryCompiler.setUpdatingEnabled(XQueryCompiler.java:212)

at net.sf.saxon.Query.doQuery(Query.java:281) 在net.sf.saxon.Query.doQuery(Query.java:281)

at net.sf.saxon.Query.main(Query.java:111) 在net.sf.saxon.Query.main(Query.java:111)

Fatal error during query: java.lang.UnsupportedOperationException: XQuery Update is not supported in this Saxon Configuration 查询期间发生致命错误:java.lang.UnsupportedOperationException:此Saxon配置中不支持XQuery Update

The filename, directory name, or volume label syntax is incorrect. 文件名,目录名称或卷标签语法不正确。

Java 8 is installed on my machine. 我的机器上已安装Java 8。 I have also ensured that the XQuery Update still works when called from within the oXygen editor. 从oXygen编辑器中调用时,我还确保了XQuery Update仍能正常工作。

After reading up on http://www.saxonica.com/documentation9.6/index.html#!using-xquery/commandline and http://www.saxonica.com/documentation9.6/index.html#!conformance/update , I added the -tree:linked flag and the -qversion:1.0 flag (they result in the same error message): http://www.saxonica.com/documentation9.6/index.html#!using-xquery/commandlinehttp://www.saxonica.com/documentation9.6/index.html#!conformance/上阅读后更新 ,我添加了-tree:linked标志和-qversion:1.0标志(它们导致相同的错误消息):

java -cp "C:\Program Files\Oxygen XML Editor 17\lib\saxon9ee.jar" net.sf.saxon.Query -qversion:1.0 -tree:linked -update:on -t -q:"C:\Users\%USERNAME%\Documents\SVN Working Copies\trunk\rbscXSL\Locations2015\AbID2dsc-items.xq"

According to the documentation, XQuery Update should run if the -update:on flag is set, which it is, and the XML is read in using the doc() or collection() function, which is also the case--these are the variables from my XQuery file: 根据文档,如果设置了-update:on标志,则XQuery Update应该运行,并且使用doc()或collection()函数读取XML,情况也是如此-这些是我的XQuery文件中的变量:

declare variable $EAD as document-node()* := doc("sample_input.xml");
declare variable $ITEMS as document-node()* := doc("sample_input.AbID.xml");

I'm at a loss what else to try. 我无所适从。 If anyone can see what's going wrong here, I'd greatly appreciate any pointers! 如果有人看到这里出了什么问题,我将不胜感激任何指点!

Do you have your own Saxon-EE license, or are you relying on the license that comes with oXygen? 您是否拥有自己的Saxon-EE许可证,还是依赖于oXygen随附的许可证? The oXygen license does not cover use of Saxon-EE outside of oXygen itself (so it doesn't cover the way you are running Saxon from the command line). oXygen许可证不涵盖oXygen本身以外的Saxon-EE使用(因此,它不涵盖您从命令行运行Saxon的方式)。 Perhaps you found a loophole in the way oXygen handles the Saxon activation that worked in earlier releases but has since been fixed, either in oXygen or in Saxon. 也许您发现oXygen处理Saxon激活的方式中存在漏洞,该漏洞在早期版本中有效,但此后已修复,无论是在oXygen还是在Saxon中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM