[MarkLogic Dev General] passing a document-node into an eval/invoke

Erik Zander Erik.Zander at studentlitteratur.se
Wed Feb 15 02:37:50 PST 2017


Hi All,

I did iron out why I got errors, now I could use some help finding the best solution to it.

The error is that I have code like

......

let $evalParams := map:map(
    <map:map
        xmlns:map='http://marklogic.com/xdmp/map'>
        <map:entry>
            <map:key>document</map:key>
            <map:value>{$doc}</map:value>
        </map:entry>
    </map:map>)
let $resultDocument := xdmp:eval($transformCode, $evalParams)

where in the $transform code it checks for a document-node
declare variable $document as document-node() external;

To my understanding this has to do with the map:map structure.

But is there a good way of going around it. I could use xdmp:unqote but it feels a bit messy. I could also put into the database but doing document inserts and deletions just for that feels like a bit much overhead.

Any thoughts on this is greatly appreciated.

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


More information about the General mailing list