Returns the name of a node, as an xs:QName
.
fn:node-name
( xs:QName?
fn:node-name
( $arg
as node()?
xs:QName?
If the argument is omitted, it defaults to the context item (.
). The
behavior of the function if the argument is omitted is exactly the same as if the
context item had been passed as the argument.
If $arg
is the empty sequence, the empty sequence is returned.
Otherwise, the function returns the result of the dm:node-name
accessor as
defined in (see ).
The following errors may be raised when $arg
is omitted:
If the context item is absent, dynamic error
If the context item is not a node, type error .
For element and attribute nodes, the name of the node is returned as an
xs:QName
, retaining the prefix, namespace URI, and local part.
For processing instructions, the name of the node is returned as an
xs:QName
in which the prefix and namespace URI are absent.
For a namespace node, the function returns an empty sequence if the node represents the
default namespace; otherwise it returns an xs:QName
in which prefix and
namespace URI are absent and the local
part is the namespace prefix being bound.
For all other kinds of node, the function returns the empty sequence.