Description
The functx:sort-document-order function sorts a sequence of nodes in document order. This can be done with a simple path expression, but the function is useful for making the purpose of the expression clear.
Arguments and Return Type| Name | Type | Description |
$seq |
node()* |
the sequence to sort |
| 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:sort-document-order
( $seq as node()* ) as node()* {
$seq/.
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function sort-document-order
( $seq as node()* ) as node()* {
$seq/.
} |
Exampleslet $in-xml := | <in-xml>
<a>123</a>
<b>456</b>
<c>789</c>
</in-xml> | return |
| XQuery Example | Results |
|---|
functx:sort-document-order(
($in-xml/c,$in-xml/a))
|
<a>123</a>
<c>789</c>
|
See AlsoHistory |
|