Hi
I know the title's a bit odd. I'm trying to set up an XQuery for which the xpath is set previously according to input parameters.
If I was going to do this normally I'd do something like:
And this would get the h2 tags from the node.
But I want to set $path= 'h2' before the xquery and then...
or I tried
Can anyone help? I think the problem is that $node is a node() type and $path is a string type so how can I join them in the same way as if I'd typed //h2?
Thanks in advance!
I know the title's a bit odd. I'm trying to set up an XQuery for which the xpath is set previously according to input parameters.
If I was going to do this normally I'd do something like:
Code:
let $first := data($node//h2)
But I want to set $path= 'h2' before the xquery and then...
Code:
let $first := data($node$path)
Code:
let $first := data(concat($node,$path))
Thanks in advance!
Comment