Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
On entry to the function, the context item, position, and size are undefined. It is therefore an error to use the expression
.
, or any relative path expression, or the functions
position()
and
last()
. Even a path expression beginning with
/
is not allowed, because such path expressions select from the root of the tree containing the context node. This means that all information needed by the function must either be passed explicitly as a parameter or be available in a global variable. Path expressions such as
$par/a/b/c
can be used to navigate from nodes that are supplied as parameters to other nodes in the same tree.
Other values in the dynamic context, such as the current template, current mode, current group, and current grouping key, are also either undefined or empty on entry to a stylesheet function.
The result of the function is obtained by evaluating the sequence constructor. This result may be a sequence consisting of nodes (either newly constructed nodes or references to existing nodes) or atomic values or both. If there is an
as
attribute on the
as
attribute, then a result of any type may be returned, and no checking or conversion takes place.
The override Attribute
The
override
attribute controls what happens if a user-written function and a vendor-supplied function have the same name.