For example, in the following module (which demonstrates at least one
approach to the problem) I set the global error variable to true() if a
certain condition is met:

 

xquery version "1.0-ml";

 

declare namespace t = "test";

declare variable $t:error := false();

 

declare function t:test($val)

{(

    if ($val eq "b") then xdmp:set($t:error, true()) else (),

    $val

)};

 

let $val1 := t:test("a")

let $val2 := t:test("b")

let $val3 := t:test("c")

 

return (

    $val1, ", ", $val3, ", ", $val2, ", ", 

    if ($t:error) then "oops" else "okay"

)

 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Geert Josten
Sent: Thursday, September 15, 2011 10:03 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to effectively pass variables by
reference to an xquery function?

 

Hi Tim,

 

Can you elaborate a bit more on the use case?

 

Kind regards,

Geert

 


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to