xquery: Input Parameters by ref or val?

  • 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")

    I get the following error

    XQuery syntax error on line 7 in ...turn &lt;set&gt; {$test:put(&quot;key2&quot;:
    expected "<name>", found "<function>("

    Thanks in advance,

    • 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