fn:local-name

Return local name of node.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:local-name(node $node) => string

Description

This function returns the local part of the name of $node. If $node has no name, because it is a document node, a comment node, or a text node, the function returns a string of length zero.

Argument

$node

node

Examples

  • Retrieve local name from element nodes:

    let $a := input()/bib/book[1]
    return local-name($a)

    This query returns the string value "book"

  • Retrieve local name from comment nodes:

    for $a in input()//comment()
    return local-name($a)

    This query returns as many zero-length string values as there are comment nodes in the current collection.