[basex-talk] dynamically evaluate XPath

2013-11-11 Thread Imsieke, Gerrit, le-tex
I have a RESTXQ path/function that is supposed to retrieve a document fragment, restricted to an XPath expression that is given as a query parameter, i.e., as a string. The list of possible fragment XPaths has been calculated using path() by another function, and the user of a Web application

Re: [basex-talk] dynamically evaluate XPath

2013-11-11 Thread Christian Grün
Hi Gerrit, you are probably looking for the xquery:eval function [1]: xquery:eval( db:open(' || $db || ', ' || $doc || ') || $xpath) You can make the query string safer by bind ing variables to the evaluated expression: xquery:eval( db:open($db, $doc) || $xpath, map { db := $db, doc =

Re: [basex-talk] dynamically evaluate XPath

2013-11-11 Thread Imsieke, Gerrit, le-tex
Thanks Christian, that’s it! On 11.11.2013 13:49, Christian Grün wrote: Hi Gerrit, you are probably looking for the xquery:eval function [1]: xquery:eval( db:open(' || $db || ', ' || $doc || ') || $xpath) ___ BaseX-Talk mailing list