qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] Globals


From: Per Bothner
Subject: Re: [Qexo-general] Globals
Date: Sun, 20 Apr 2003 17:42:05 -0700
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312

Seshukumar Venkata Adiraju wrote:
Is there any way I can bind some global constants before executing a xquery?

This is an important feature, I think, but there isn't yet a standard
way to do it, so I'm loath to specify a mechanism yet, at least until
I see the next draft.

However, this is a way to do it at the Java level:

    XQuery xq = new XQuery();
    xq.define("val1", "foo");

You seem to be using an old version of Qexo - I don't see
Environment.addBinding.

What also works is to define a function in a file thus:

define function foo($var1) {
  <result>{$var1}</result>
}

You can then load this file and call the function.
For example thus:

$ java kawa.repl -f /tmp/foo.xql --
{-- 1--} foo(2)
<result>2</result>
--
        --Per Bothner
address@hidden   http://per.bothner.com/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]