|Additional XPath Functions|
Sort a node set by the specified sort keys.
NodeSet sort (XPath expression, String sortKey)
NodeSet sort (XPath expression, String sortKey, String sortKey2, ...)
|XPath expression||an XPath expression identifying the nodes to sort|
|String sortKey||a quoted String containing an XPath expression for a sort key. The XPath expression is evaluated relative to each node in the node set being sorted. Optionally, the string my be suffixed with ::ascending or ::descending to indicate sort direction. The default sort direction is ascending.|
|String sortKeyN||a secondary sort key should previous keys have resulted in equality. Format rules are as with sorkKey.|
returns a node set of phone book entries sorted by lastNamesort(/phonebook/entry, 'substring(@lastName, 1, 1)::descending', @firstName::ascending)
returns a node set of phone book entries sorted in reverse order by the first letter of lastName and, within each letter, alphabetically by firstName
© Copyright IBM Corporation 2000, 2008. All Rights Reserved.