在 MarkLogic 服务器中安装转换
Installing Transformations in MarkLogic Server
我正在尝试将转换加载到 marklogic 数据库,但失败导致 "either is not a valid module or does not provide extension functions (transform) in the http://marklogic.com/rest-api/transform/validate namespace"。
我的xqy文件如下:
xquery version "1.0-ml";
module namespace trans = "http://marklogic.com/rest-api/transform/validate";
declare function trans:transform(
$context as map:map,
$params as map:map,
$content as document-node()
) as document-node()
{
let $validate := validate strict { $content }
return $content;
};
我是运行以下命令:
curl --anyauth --user admin:admin -X PUT -d@"./filetype_xform.xqy" -i -H "Content-type: application/xquery" 'http://localhost:8061/v1/config/transforms/validate'
我看到的错误是:
HTTP/1.1 400 错误请求
内容类型:application/json;字符集=UTF-8
服务器:MarkLogic
内容长度:557
连接:保持活动
保持活动:超时=5
{"errorResponse":{"statusCode":400, "status":"Bad Request", "messageCode":"RESTAPI-INVALIDCONTENT", "message":"RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: invalid validate extension: could not parse XQuery extension validate; please see the server error log for detail XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected Rbrace_, expecting Function30_ or Percent_; validate either is not a valid module or does not provide extension functions (transform) in the http://marklogic.com/rest-api/transform/validate namespace"}}[admin@localhost transformations]
对于解决此问题的任何帮助,我表示感谢。
只需在 return $content:
后删除分号
xquery version "1.0-ml";
module namespace trans = "http://marklogic.com/rest-api/transform/validate";
declare function trans:transform(
$context as map:map,
$params as map:map,
$content as document-node()
) as document-node()
{
let $validate := validate strict { $content }
return $content
};
我正在尝试将转换加载到 marklogic 数据库,但失败导致 "either is not a valid module or does not provide extension functions (transform) in the http://marklogic.com/rest-api/transform/validate namespace"。
我的xqy文件如下:
xquery version "1.0-ml";
module namespace trans = "http://marklogic.com/rest-api/transform/validate";
declare function trans:transform(
$context as map:map,
$params as map:map,
$content as document-node()
) as document-node()
{
let $validate := validate strict { $content }
return $content;
};
我是运行以下命令:
curl --anyauth --user admin:admin -X PUT -d@"./filetype_xform.xqy" -i -H "Content-type: application/xquery" 'http://localhost:8061/v1/config/transforms/validate'
我看到的错误是: HTTP/1.1 400 错误请求 内容类型:application/json;字符集=UTF-8 服务器:MarkLogic 内容长度:557 连接:保持活动 保持活动:超时=5
{"errorResponse":{"statusCode":400, "status":"Bad Request", "messageCode":"RESTAPI-INVALIDCONTENT", "message":"RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: invalid validate extension: could not parse XQuery extension validate; please see the server error log for detail XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected Rbrace_, expecting Function30_ or Percent_; validate either is not a valid module or does not provide extension functions (transform) in the http://marklogic.com/rest-api/transform/validate namespace"}}[admin@localhost transformations]
对于解决此问题的任何帮助,我表示感谢。
只需在 return $content:
后删除分号xquery version "1.0-ml";
module namespace trans = "http://marklogic.com/rest-api/transform/validate";
declare function trans:transform(
$context as map:map,
$params as map:map,
$content as document-node()
) as document-node()
{
let $validate := validate strict { $content }
return $content
};