Xquery exist db:EXER:ERROR变量$request未绑定到Java对象

Xquery exist db:EXER:ERROR变量$request未绑定到Java对象,xquery,exist-db,Xquery,Exist Db,在我的exist db 2.2 RC1中有以下RESTXQ脚本。 我试图将URL参数“path”路径设置到主函数,但收到错误 错误变量$request未绑定到Java对象 xquery version "3.0"; module namespace services = "http://my/services"; import module namespace transform = "http://exist-db.org/xquery/transform"; declare namesp

在我的exist db 2.2 RC1中有以下RESTXQ脚本。 我试图将URL参数“path”路径设置到主函数,但收到错误

错误变量$request未绑定到Java对象

xquery version "3.0";

module namespace services = "http://my/services";

import module namespace transform = "http://exist-db.org/xquery/transform";
declare namespace request="http://exist-db.org/xquery/request";
declare namespace rest = "http://exquery.org/ns/restxq";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare namespace json="http://www.json.org";    

declare function local:trim($arg as xs:string?) as xs:string {
    replace(replace($arg,'\s+$',''),'^\s+','')
} ;

....

declare
    %private
function services:func() {

    let $path := request:get-parameter('path', '')
    let $doc := doc(path)
    return 
        <item>
            <uri>{ base-uri($doc) }</uri>
....

eXist请求、响应和会话模块在RESTXQ中不可用,因为它有自己的机制。因此,您将无法使用
declare namespace request=”中的任何函数http://exist-db.org/xquery/request";

eXist请求、响应和会话模块在RESTXQ中不可用,因为它有自己的机制。因此,您将无法使用
declare namespace request=”中的任何函数http://exist-db.org/xquery/request";

Problem accessing /exist/restxq/document-metadata.json. Reason:

    exerr:ERROR Variable $request is not bound to an Java object. [at line 46, column 18, source: /db/scripts/document-metadata.xql]
In function:
    services:func() [26:3:/db/scripts/document-metadata.xql]
    services:home-json() [-1:-1:/db/scripts/document-metadata.xql]