![](/img/trans.png)
[英]How do I get output for a XQuery in MarkLogic in a one line output?
[英]How do I get the HTTP POST body in MarkLogic XQuery?
我正在嘗試使用exists-db request:get-data()
方法來獲取請求的發布數據。 但是,我收到錯誤:
XDMP-UNDFUN :(錯誤:XPST0017)未定義的函數請求:get-data()
我確實在我的標題中聲明了命名空間。 我不明白為什么我仍然不能使用request:get-data()
或任何其他請求:函數
declare namespace request="http://exist-db.org/xquery/request";
declare option exist:serialize "method=xml media-type=text/xml indent=yes";
let $post-data := request:get-data()
return $post-data
我想你正在尋找xdmp:get-request-body 。
Sam向您指出了您需要的功能,但我想回答您問題的另一部分:
我確實在我的標題中聲明了命名空間。 我不明白為什么我仍然不能使用request:get-data()或任何其他請求:函數
每個XQuery處理引擎都實現標准功能 ,但還需要標准未定義的其他功能。 對於MarkLogic,您將使用帶有fn:
前綴的標准函數。
然后,每個XQuery引擎都定義了所需的其他功能。 對於Exist DB,其中一些位於“ http://exist-db.org/xquery/request ”命名空間中,而MarkLogic使用“ http://marklogic.com/xdmp ”來實現其許多擴展功能。
當您在尋找與Exist DB特定功能相當的MarkLogic時,請在http://docs.marklogic.com上搜索 - 從函數名稱開始,如果這不起作用,請搜索描述的術語你想做什么。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.