Name
xpath_funcall, xpath_apply — programmatically call XPath built-in functions and apply XPath to a node sequence
Synopsis
any xpath_funcall(
|
in function_name varchar, |
| in entity XML, | |
in args any); |
any xpath_apply(
|
in xpath varchar, |
| in entity_sequence any, | |
in variables any); |
Description
xpath_funcall directly invokes the XPath built-in
function named function_name (e.g.
'string-length', 'normalize-space',
'translate') on entity, passing
the vector args as positional arguments. The
function name may be prefixed with an XPath/XQuery extension namespace
(e.g. 'fn:string-length'); unprefixed names default to
the core XPath function library.
xpath_apply evaluates xpath
against every entity in the entity_sequence vector
in turn and returns the concatenated result sequence. This is the
multi-document analogue of
xpath_eval; use
it to run the same XPath over the result of a SQL query that returns
several XML values.
Both BIFs have __w_cache variants
(xpath_funcall__w_cache,
xpath_apply__w_cache) which reuse the compiled XPath
across calls. See
xpath_eval__w_cache
for guidance on when to prefer the cached form.