fn:reverse

Reverses the order of items in a sequence.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:reverse(sequence $sequence) => sequence

Description

This function returns the input sequence in reversed order.

Argument

$sequence

sequence

Example

  • Retrieve the last name of every author and reverse the obtained sequence:

    declare namespace ino="http://namespaces.softwareag.com/tamino/response2"
    let $authors := input()//author/last
    return ($authors,<delimiter/>,reverse($authors))
    

    The query returns all authers and, seperated by a construncted delimiter-node, the authors in reversed order.