How to pass an xpath into an xquery function declaration
- by topmulch
Hi all,
I use Apache Tomcat's Exist DB as an XML database and am trying to construct a sequence by passing the following xpath, defined in FLWOR's 'let' clause:
$xpath := $root/second/third
into a locally defined function declaration, like so:
declare function local:someFunction($uuid as xs:string?, $xpath as xs:anyAtomicType?)
{
let $varOne := $xpath/fourth[@uuid = $uuid]/fifthRight
let $varTwo := $xpath/fourth[@uuid = $uuid]/fifthLeft
let $combined := ($varOne,$varTwo)
return $combined
};
Of course, when entering this in the exist xquery sandbox, I get Type: xs:anyAtomicType is not defined. What should I use in place of it, or should I do this a different way?
Thanks in advance for any suggestions.