Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse JET Guide
Previous Page Home Next Page


Additional XPath Functions


Sort a node set by the specified sort keys.

Function Summary
minimal arguments NodeSet sort (XPath expression, String sortKey)
all arguments NodeSet sort (XPath expression, String sortKey, String sortKey2, ...)

Required Arguments
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.

Optional arguments
String sortKeyN a secondary sort key should previous keys have resulted in equality. Format rules are as with sorkKey.

sort(/phonebook/entry, '@lastName')

returns a node set of phone book entries sorted by lastName

sort(/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.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire