node-name function
The fn:node-name function returns the expanded QName of a node.
Syntax
- node
- The node for which the expanded name is to be retrieved.
Returned value
The returned value is an xs:QName value that contains the expanded QName for node. If node is an empty sequence, an empty sequence is returned.
Example
The following query returns the
expanded QName that corresponds to the URI http://www.mycompany.com
and the lexical QName comp:emp:
declare namespace d="http://www.mycompany.com";
let $department := document {
<comp:dept xmlns:comp="http://www.mycompany.com" id="A07">
<comp:emp id="31201" />
</comp:dept> }
return fn:node-name($department/d:dept/d:emp)