eXist-DB / 查询 XSL 转换:未定义的上下文序列

eXist-DB / Query XSL transform: undefined context sequence

环境:eXist-db 4.2.1、XQuery 3.1、XSLT 2.0

我正在尝试使用由 eXist-DB/Query 3.1 触发的 XSLT 2.0 样式表转换 XML 文档。我收到以下错误

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 行是 </parameters>),(),xinclude-path=$globalvar:URIdb):

declare function document:doc-xsl-docview($node as node(), 
        $model as map(*), $currentdoc as xs:string)

{   
  let $currentdocnode := doc(concat($globalvar:URIdb,$currentdoc))

  let $xsltransform := transform:transform(
                        $currentdocnode, 
                        concat($globalvar:URIstyles,
                        "ms609__testxsl-withmodes.xsl"),
                        (<parameters>
                            <param name="paramPersonurl" value="{$globalvar:URLperson}"/>
                            <param name="paramPlaceurl" value="{$globalvar:URLplace}"/>
                            <param name="paramDocurl" value="{$globalvar:URLdoc}"/>
                         </parameters>),(),xinclude-path=$globalvar:URIdb)
return $xsltransform
 };

解释以上变量:

我正在为 xi:includes 使用 transformation with serialization:

transform:transform($node-tree as node()*, $stylesheet as item(), 
                $parameters as node()?, $attributes as node()?, 
                $serialization-options as xs:string?) as node()?

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

我应该注意 $globalvar 是字符串,而不是节点。如果我需要节点,我现在在本地 'convert' 它们就像上面的 $currentdocnode 一样。

在此先感谢您帮助解决此错误。

docs for transform:transform注意序列化选项应该是字符串:

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)