pub struct FunctionCallRef {
pub namespace: String,
pub local_name: String,
pub arity: usize,
}Expand description
A distinct function call site found in a compiled XPath expression.
Produced by XPathExpr::function_calls,
which reports one entry per distinct (namespace, local_name, arity) triple
— including calls that appear inside predicates, for bodies and other
nested foci. Callers use it to detect functions whose results are not a
function of the focus and the arguments alone (fn:doc, fn:collection,
fn:unparsed-text, a host language’s key() …) without this crate having to take a
position on what “impure” means.
namespace is the namespace the call actually bound to — the namespace
of the resolved function’s signature, not the way the call was spelled. So
count(...) is reported in http://www.w3.org/2005/xpath-functions in both
XPath 2.0 and XPath 1.0 mode, even though 1.0 mode looks core functions up
without a namespace (XPath10Catalog resolves them through FN_NAMESPACE),
and a call written against the FN_2010_NAMESPACE alias is reported under
the canonical fn: namespace it resolves to. A test like
namespace == FN_NAMESPACE && local_name == "doc" is therefore mode
independent.
Only when no signature is reachable for the call — an unbound tree, or a catalog that does not describe its own handle — does this fall back to the lexical resolution of the prefix (or the static context’s default function namespace for an unprefixed call).
Fields§
§namespace: StringNamespace URI the call was bound in (may be empty).
local_name: StringLocal name of the called function.
arity: usizeNumber of arguments at the call site.