Description
The functx:last-node function returns the node in the sequence that appears last in document order (regardless of their order in the sequence). If nodes in the sequence are from multiple documents, the choice of which document is last is implementation-dependent.
Arguments and Return TypeName | Type | Description |
$nodes |
node()* |
the sequence of nodes |
return value |
node()? |
XQuery Function DeclarationSee XSLT definition. | declare namespace functx = "http://www.functx.com";
declare function functx:last-node
( $nodes as node()* ) as node()? {
($nodes/.)[last()]
} ; |
Exampleslet $in-xml := | <authors>
<author>
<fName>Kate</fName>
<lName>Jones</lName>
</author>
<author>
<fName>John</fName>
<lName>Doe</lName>
</author>
</authors> | return |
XQuery Example | Results |
---|
functx:last-node($in-xml//fName) |
<fName>John</fName> |
functx:last-node(
($in-xml//lName,
$in-xml//fName) ) |
<lName>Doe</lName> |
See AlsoHistory |
Recommended Reading:
|