Sorting
The sorting functionality is available for HTML output.
A set of sibling element nodes of the same qualified name can be sorted on one or more sort-keys you select. For example, all the Person elements (within, say, a Company element) can be sorted on the LastName child element of the Person element. The sort-key must be a node in the document, and is typically a descendant node (element or attribute) of the element node being sorted. In the example mentioned, LastName is the sort-key.
If there are two elements in the set submitted for sorting that have sort-key nodes with the same value, then an additional sort-key could provide further sorting. In the Person example just cited, in addition to a first sort-key of LastName, a second sort-key of FirstName could be specified. So, for Person elements with the same LastName value, an additional sort could be done on FirstName. In this way, in an SPS, multiple sort instructions (each using one sort-key) can be defined for a single sort action.
The template is applied to the sorted set and the results are sent to the output in the sorted order. Sorting is supported in the HTML output.
User-defined templates
User-defined templates are templates that are applied to items selected by an XPath expression you specify. The nodes selected by the XPath expression of a user-defined template can also be sorted. In this case, the sorting is applied on the user-defined template.
In this section
•The sorting mechanism is described.
•An example demonstrates how sorting is used.