The name() function returns a string in the form of a lexical QName that represents the name of a node. Typically, this will be the name of the node as written in the original XML source document, but the namespace prefix may differ .
For example, if the context node is an element named <ms:schema>, then the expression «name() » will normally return the string «ms:schema » .
Argument | Data Type | Meaning |
---|---|---|
node (optional) | node()? | Identifies the node whose name is required. If the argument is an empty sequence, the function returns a zero-length string If the argument is omitted, the target node is the context node. It is then an error if there is no context item, or if the context item is not a node |
Result | xs:string | A string value: a QName representing the name of the target node |