Is there a way to have the below code working?
let $node := 'childnode'
return
cts:search(/root/$node,
cts:and-query((
cts:collection-query('collection')
))
)
Is there a way to have the below code working?
let $node := 'childnode'
return
cts:search(/root/$node,
cts:and-query((
cts:collection-query('collection')
))
)
One way to dynamically build and execute the XPath for the cts:search
$expression
parameter is to generate the search expression as a string and then use xdmp:value()
to parse and execute:
let $node := 'childnode'
let $expression:= "/doc/" || $node
let $query as cts:query := cts:and-query((
cts:collection-query('collection')
))
return xdmp:value("cts:search("||$expression||"," ||$query||")")