[xquery-talk] questions about security and dynamically constructedqueries

Per Bothner per at bothner.com
Tue Oct 21 16:18:26 PDT 2003


Michael Kay wrote:

> I think he's looking for something like the dyn:evaluate() function in
> EXSLT. This isn't provided in XQuery 1.0 (nor in XSLT 2.0, to my
> regret).

Ah.  Qexo does support that in principle, with some caveats about the 
inherited context.

Combine the two Qexo features "Calling XQuery Expression from Java"
and "Calling Java methods from XQuery" (both described in
http://www.gnu.org/software/qexo/Running.html - which needs some
minor updating):

declare namespace XQuery = "class:gnu.xquery.lang.XQuery";
XQuery:eval(XQuery:new(), "2+2")

This returns 4, as an integer.

I hope (soon) to add an additional Java method allowing you to
explicitly pass the focus (content node, position, and count).
Passing other parts of the context, such as namespace, is more
problemtical, though at least with namespace you have the option of
passing them explicly in the prologue part of the query string.
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/




More information about the talk mailing list