How to register xquery functions in oracle?
Hi.
I'm trying to create and use functions locally (example below).
The problem is that I can't reuse them. Whenever I need to use them, I need to redeclare them.
select
xmlquery ( declare function local:remove-elements-deep ( $nodes as node()* ,
$names as xs:string* ) as node()* { for $node in $nodes return
if ($node instance of element())
then
if (local:name-test(name($node),$names))
then ()
else element { node-name($node)}
{ $node/@*, local:remove-elements-deep($node/node(), $names)}
else
if ($node instance of document-node())
then local:remove-elements-deep($node/node(), $names)
else $node }
How do I register this function in the database and not have to declare them whenever I need to?