MarkLogic 10 Product Documentation
fn.nodeName

fn.nodeName(
   arg as Node?
) as xs.QName?

Summary

Returns an expanded-QName for node kinds that can have names. For other kinds of nodes it returns the empty sequence. If $arg is the empty sequence, the empty sequence is returned.

Parameters
arg The node whose name is to be returned.

Example

var x = fn.head(xdmp.unquote('<hello><goodbye>1</goodbye></hello>'));
fn.nodeName(x.xpath("/child::element()"));

=> hello (because the xdmp.unquote produces a Sequence 
          containing a document node, and the xpath starts at the
	  document node and selects the sequence of child elements,
	  which in this case is the root node named "hello")
Powered by MarkLogic Server | Terms of Use | Privacy Policy