Subject:Receiving a function as a parameter, and operate it. Author:Maya B Date:18 Jul 2006 11:33 AM Originally Posted: 18 Jul 2006 11:31 AM
In xquery in the running time,
I am dynamicly building a function (as a string).
I need a function :
that receives the function (that I built as a string) and a parameter
(as the variables) - and operate the function on the paramater.
such as :
declare function operate ($func($p as element) as function, $p as element)
{
@($func($p))
};
Is it possible to preform this in xquery,
and If not, how can I preform this (using other languages),
when the function is dynamicly built in xquery (as a string)?
Subject:Receiving a function as a parameter, and operate it. Author:Ivan Pedruzzi Date:18 Jul 2006 12:01 PM
Hi Maya,
Most of the XQuery implementations do not support to evaluate code at
run-time.
Doing it with multiple queries should be simple.
The query processor you are planing to use dictates which API you will need to learn.
Almost all XQuery implementations allow to read a xquery expression from string, stream or file.
Subject:Receiving a function as a parameter, and operate it. Author:Maya B Date:18 Jul 2006 12:17 PM
From your answer I still didn't get how do I implement this on xquery (using stylus studio engine or any other engine that you might suggest),
[ and using run time evaluating code ]
If you could give me a specific example that would be really good.
Subject:Receiving a function as a parameter, and operate it. Author:Maya B Date:18 Jul 2006 12:41 PM Originally Posted: 18 Jul 2006 12:38 PM
The problem is as follow,
Input :
1. XML document describing a query (on graph stracture).
2. XML document describing a Graph
[the graph might be on more then one document but this I discover or run time]
I need to translate the query written in XML to an
Xquery function and operate it on the first graph.
Also since there might be more then one destination graph,
(and this I discover during run time after going over the first document)
I might need to divide the query I build for some of it querying
different graphs (on different documents).
- Therefore, for each graph I will need to generate a query that fits
it, and I need to operate those dynamicly -run time- builded queries,
on the different graphs.
How do I preform this?
(assuming: 1. I know how to build the queries as string
2. The destination files (except from the first) - I discover during run time )