The formal definition of the unordered() function is that it returns a sequence that is an arbitrary re-ordering of the sequence provided as its argument. In practice, this is really a pseudo-function: wrapping an expression in a call of unordered() tells the XPath processor that you don't care what order the results of that expression are in, which means that the processor might be able to avoid the cost of sorting them into a specific order.
For example, «unordered( ancestor ::*) » returns the ancestor elements in whatever order the system finds most convenient . (In Saxon, it currently returns them in reverse document order, that is, innermost ancestor first.)
Argument | Data Type | Meaning |
---|---|---|
sequence | item()* | The supplied sequence |
Result | item()* | A sequence that contains the same items as the supplied sequence, but in an arbitrary order |