[XQZone General] Xquery Related Question

Stewart, Joel (LNG-DAY) joel.stewart at lexisnexis.com
Tue Dec 13 06:56:59 PST 2005


You can use the xdmp:eval()

Essentially build a string of the query and call it

Let $bool_op := "<"
Let $query := fn:concat("collection(""collectionName"")/root/node[@value
",$bool_op," ]")
Let $result := xdmp:eval($query)

But beware doing it with update queries.  It may commit things that you
would normally want to rollback if there are problems further down in
the query function.

joel

-----Original Message-----
From: general-bounces at xqzone.marklogic.com
[mailto:general-bounces at xqzone.marklogic.com] On Behalf Of Sandesh Pai
Sent: Tuesday, December 13, 2005 9:49 AM
To: General XQZone Discussion
Subject: [XQZone General] Xquery Related Question

Hi,
   I have one question regarding XQuery.
Is it possible to construct the Xquery expression dynamically?
Eg:
collection("collectionName")/root/node[@value > 1000]

Here the condition Greater Than or Less Than Depends on User input, So
what I want is,

I would like to have this query in a  file which I read during run
time and dynamically set the condition.


Please let me know if it is possible to do and If yes please give a
small example

regards
Sandesh
_______________________________________________
General mailing list
General at xqzone.marklogic.com
http://xqzone.com/mailman/listinfo/general



More information about the General mailing list