Project

Profile

Help

xquery: Input Parameters by ref or val?

Added by Anonymous about 20 years ago

Legacy ID: #2811889 Legacy Poster: g_ball (gjball)

I would like to be able to manipulate global java variables from with in the scope of my xquery. for example; 1) calling java class instantiate a hashmap. 2) setparameter(hashmap) 3) run query 4) query calls map.add(name, "value") 5) xquery terminates 5) java caller can read the new value I am having two troubles: 1) setparameter seems to copy the object value instead of giving the actual reference 2) I am trying to find a way of declaring a custom object as external variable. here is what I have tried: ----------------------------------------- declare namespace j = "http://saxon.sf.net/java-type"; declare variable $test as j:java.util.HashMap external; let $empid := doc("ref/EmployeeId.xml") return <set> {$test:put("key2","val2")} </set> ---------------------------------- I get the following error -------------------------------- Error XQuery syntax error on line 7 in ...turn &lt;set&gt; {$test:put(&quot;key2&quot;: expected "<name>", found "<function>(" --------------------------------------------- Thanks in advance, Greg


Replies (1)

RE: xquery: Input Parameters by ref or val? - Added by Anonymous about 20 years ago

Legacy ID: #2811927 Legacy Poster: Michael Kay (mhkay)

I replied to this on the other thread.

    (1-1/1)

    Please register to reply