Name

unordered — Returns the given sequence in any order.

Synopsis

sequence unordered ( input sequence );

Description

The function takes a sequence, or more typically an expression that evaluates to a sequence, and indicates that the result sequence may be returned in any order.

Parameters

input

The sequence of nodes

Return Types

Sequence

Examples

Example24.636.Finding pairs of books

The following example is from the XQuery standard and it illustrates how to find pairs of books that have different titles but the same set of authors (possibly in a different order).

<bib>
{
   for $book1 in document("bib.xml")/bib/book,
       $book2 in document("bib.xml")/bib/book
   where $book1/title > $book2/title
   and $book1/author = $book2/author
   return
      <book-pair>
         { $book1/title, $book2/title }
      </book-pair>
}
</bib>