【问题标题】:XDMP-BADCHAR : Unexpected character found '\"'XDMP-BADCHAR : 发现意外字符 '\"'
【发布时间】:2017-08-11 07:47:20
【问题描述】:

我尝试通过 API 启动以下 Xquery 查询(我点击了链接:https://docs.marklogic.com/8.0/REST/POST/v1/eval)。

它适用于基本示例,但是当我尝试使用查询从 ML 中提取数据并将它们保存到磁盘时,出现以下错误:

{"errorResponse":{"statusCode":500, "status":"Internal Server Error", "messageCode":"XDMP-BADCHAR", "message":"XDMP-BADCHAR: (err:XPST0003) Unexpected character found '\"' (0x0022)", "messageDetail":{"messageTitle":"Unexpected character found"}}}

我的 xquery 文件包含:

xquery=
xquery version "1.0-ml";
xdmp:save("toto.csv",let $nl := "
" return document { for $book in collection("book")/optIns where root($book)/duplicate eq false() return (root($book)/contactId||","|| root($book)/countryCode||$optin/updatedDate||$nl)})

谢谢, 罗曼。

【问题讨论】:

  • 在您的文件中,我看不到您在哪里指定内容数据库。查看用于执行脚本的 curl 命令也可能会有所帮助。
  • 嗨,你是对的!我在 curl 命令中使用 "?database=XYZ" 指定它

标签: marklogic marklogic-8


【解决方案1】:

您的查询文本中可能有一些需要进行 URL 编码的内容。尝试使用--data-urlencode 而不是-d,或者在将表单值传递给 curl 之前对其进行 URL 编码。

【讨论】:

    猜你喜欢
    • 2022-07-05
    • 2015-01-17
    • 1970-01-01
    • 2019-08-07
    • 1970-01-01
    • 1970-01-01
    • 2015-07-01
    • 2016-08-08
    • 2022-01-01
    相关资源
    最近更新 更多