I'm trying to do something similar to this because I'll have to deal with xpaths provided by end users as parameters to a rest query:
var xpath='div/p'
for $i in db:open('en-us'){$xpath}
return $i
I saw that it's possible to do it with other tools, but I didn't find if it's possible with xquery and BaseX.
How SQL dbs do it:
SET @PATH = '/Root[1]/Device[1]/Inspection[1]/Status[1]'
SELECT @XML1.query(@PATH)
Any suggestion that doesn't involve analyzing the query string and trying to rebuild it in some way?
--