home contribute faq download

FunctX XQuery Functions

fn:reverse

Reverses the order of a sequence

Google
Webdatypic.com

Description

The fn:reverse function reverses the order of the items in a sequence. These items may be nodes, or atomic values, or both.

This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book.

Arguments and Return Type

NameType
$arg item()*
return value item()*

Examples

XQuery ExampleResults
reverse( (1, 2, 3, 4, 5) )
(5, 4, 3, 2, 1)
reverse( (6, 2, 4) )
(4, 2, 6)
reverse( () )
()

See Also

functx:reverse-stringReverses the order of characters

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XQuery Services

Recommended Reading:

XQuery