fn:name()
Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an 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.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If the argument is supplied and is the empty sequence, the function returns the zero-length string.
If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
Otherwise, the value returned is fn:string(fn:node-name($arg)).
Arguments:
| Type |
Description |
| node? |
Node to display name. |
Return type: xs:string
Examples:
| Query |
Result |
| name(/l:library) |
l:library |
W3C Documentation reference
fn:local-name()
Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
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.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If the argument is supplied and is the empty sequence, the function returns the zero-length string.
If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.
Arguments:
| Type |
Description |
| node? |
Node to display local-name. |
Return type: xs:string
Examples:
| Query |
Result |
| name(/l:library) |
library |
W3C Documentation reference
fn:nilled()
Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
Arguments:
| Type |
Description |
| node? |
Node to test. |
Return type: xs:boolean?
Examples:
| Query |
Result |
| nilled(/l:library) |
false |
W3C Documentation reference
fn:base-uri()
Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If $arg is the empty sequence, the empty sequence is returned.
Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
Arguments:
| Type |
Description |
| node? |
Node to find base URI of. |
Return type: xs:anyURI?
Examples:
| Query |
Result |
| base-uri(/l:library/l:libraryName) |
<empty sequence> |
W3C Documentation reference
fn:document-uri()
Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
If $arg is the empty sequence, the empty sequence is returned.
Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
Arguments:
| Type |
Description |
| node? |
Node which document-uri value needs to be returned. |
Return type: xs:anyURI?
Examples:
| Query |
Result |
| document-uri(/l:library/l:libraryName) |
<empty sequence> |
W3C Documentation reference
fn:last()
Returns the position of the last node in the context list
W3C Documentation reference: Node-Set-Functions