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

Erik Zander Erik.Zander at studentlitteratur.se
Wed Feb 15 01:14:38 PST 2017


Hi Gert,

Thanks for confirming I wasn't way of :)
The body isn't empty but it doesn't matter as the error seams to be elsewhere anyway.

Regards Erik

Från: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] För Geert Josten
Skickat: den 15 februari 2017 10:07
Till: MarkLogic Developer Discussion <general at developer.marklogic.com>
Ämne: Re: [MarkLogic Dev General] xdmp:get-request-body(); as document-node

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/3fdb0e7e/attachment.html 


More information about the General mailing list