Description
The functx:first-node function returns the node in the sequence that appears first in document order. If nodes in the sequence are from multiple documents, which document is first is implementation-dependent.
Arguments and Return Type| Name | Type | Description |
$nodes |
node()* |
the sequence of nodes |
| return value |
node()? |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for July 2004 - January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:first-node
( $nodes as node()* ) as node()? {
($nodes/.)[1]
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function first-node
( $nodes as node()* ) as node()? {
($nodes/.)[1]
} |
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:first-node($in-xml//fName)
|
<fName>Kate</fName>
|
functx:first-node(
($in-xml//lName,
$in-xml//fName) )
|
<fName>Kate</fName>
|
See AlsoHistory |
|