最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

saxon - Support for XQuery Update facility in XSLT 3.0 - Stack Overflow

programmeradmin2浏览0评论

In a previous question I've asked about support for running XQuery in XSLT 3.0. (Is there a way to run XQuery functions / or XQuery scripts locally within an XSLT script file?) and the answer was it's possible using saxon:compile-query/saxon:query however I'm now curious to know whether this would allow one to run XQuery with the Update facility e.g. run a copy modify return expression or an update function? All in Saxon EE 9.9.

In a previous question I've asked about support for running XQuery in XSLT 3.0. (Is there a way to run XQuery functions / or XQuery scripts locally within an XSLT script file?) and the answer was it's possible using saxon:compile-query/saxon:query however I'm now curious to know whether this would allow one to run XQuery with the Update facility e.g. run a copy modify return expression or an update function? All in Saxon EE 9.9.

Share Improve this question asked Feb 4 at 16:59 AlexAlex 295 bronze badges 3
  • Perhaps give it a try, with API based query compilation you have to explicitly set saxonica/html/documentation9.9/javadoc/net/sf/saxon/s9api/… to compile XQuery Update code, I am not sure whether the saxon:compile-query code does that to ensure any kind of query is compilable. – Martin Honnen Commented Feb 4 at 18:07
  • I think it might boil down to the configuration used, if you ensure you load it from a configuration file where e.g. <xquery allowUpdate="true"/> is or if you programmatically set the configuration feature Feature.XQUERY_ALLOW_UPDATE to true then the StaticQueryContext created for the saxon:compile-query is probably one where isUpdatingEnabled is true. Wait for an answer from Michael Kay, he knows that stuff much better. – Martin Honnen Commented Feb 4 at 20:19
  • On the other hand, I am currently wondering whether, to run an updating query and process its result, you would usually not need some special Java code. So not sure whether the code processing a query with saxon:query is up to the task to process an updating query, even if you get it compiled. – Martin Honnen Commented Feb 4 at 20:41
Add a comment  | 

1 Answer 1

Reset to default 0

There's certainly no proven/validated/supported/out-of-the-box way of doing this. It can probably be done by crafting your own Java extension functions.

发布评论

评论列表(0)

  1. 暂无评论