xquery: Input Parameters by ref or val?

Help
g_ball
2004-10-19
2012-10-08
  • g_ball

    g_ball - 2004-10-19

    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

     
    • Michael Kay

      Michael Kay - 2004-10-19

      I replied to this on the other thread.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks