[MarkLogic Dev General] xdmp:get-request-body(); as document-node

Geert Josten Geert.Josten at marklogic.com
Wed Feb 15 01:07:01 PST 2017


Hi Erik,

I think it is supposed to return a document-node, and if it doesn’t perhaps the body is empty. You can find some usage notes here:

http://docs.marklogic.com/xdmp:get-request-body

And yes, normally `document { $body }` should do the trick, but if $body is empty, you end up with an empty doc node..

Cheers,
Geert

From: <general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>> on behalf of Erik Zander <Erik.Zander at studentlitteratur.se<mailto:Erik.Zander at studentlitteratur.se>>
Reply-To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Date: Wednesday, February 15, 2017 at 9:54 AM
To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Subject: [MarkLogic Dev General] xdmp:get-request-body(); as document-node

Hi All,

I hope you can help me here as my memory won’t cooperate :)

I’m using
declare variable $xmlBody := xdmp:get-request-body();    <= input here is a post with content-type application/xml

and later in the code I check that it’s a document node but that check fails

How can I convert the $xmlBody into a document node? Document{$xmlbody} didn’t do the trick.

Regards
Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20170215/422f7f42/attachment.html 


More information about the General mailing list