Xquery eXist DB/Query XSL转换:未定义的上下文序列

Xquery eXist DB/Query XSL转换:未定义的上下文序列,xquery,xslt-2.0,exist-db,xquery-3.0,Xquery,Xslt 2.0,Exist Db,Xquery 3.0,环境:eXistDB4.2.1、XQuery 3.1、XSLT2.0 我试图用XSLT2.0样式表转换XML文档,由eXist DB/Query 3.1触发。我收到以下错误 err:XPDY0002 Undefined context sequence for 'child::{}xinclude-path' [at line 271, column 48, source: /db/apps/deheresi/modules/document.xql] 此错误指向document.xqm模块

环境:eXistDB4.2.1、XQuery 3.1、XSLT2.0

我试图用XSLT2.0样式表转换XML文档,由eXist DB/Query 3.1触发。我收到以下错误

err:XPDY0002 Undefined context sequence for 'child::{}xinclude-path' 
[at line 271, column 48, source: /db/apps/deheresi/modules/document.xql]
此错误指向document.xqm模块中的以下XQuery,行217为
),(),xinclude path=$globalvar:URIdb)

我需要传递xinclude path=$globalvar:URIdb,以便告诉existdb在哪里处理XML文档中的
xi:includes

我应该注意,
$globalvar
是字符串,而不是节点。如果我需要节点,我会在本地“转换”它们,如上面的
$currentdocnode
所示

提前感谢您帮助解答此错误。

请注意,序列化选项应为字符串:

transform:transform($node-tree as node()*, $stylesheet as item(), 
                $parameters as node()?, $attributes as node()?, 
                $serialization-options as xs:string?) as node()?
您需要将参数括在引号中,并与全局变量连接:

concat(`xinclude-path=`, $globalvar:URIdb)

这解决了它,但产生了一个新的协议错误张贴在这里
transform:transform($node-tree as node()*, $stylesheet as item(), 
                $parameters as node()?, $attributes as node()?, 
                $serialization-options as xs:string?) as node()?
concat(`xinclude-path=`, $globalvar:URIdb)