To add an xsl:sort statement using the context menu:
-
Right-click the xsl:for-each node and select Add XSL Instruction -> sort from the context menu that appears.
The Set Attributes dialog appears.
-
Optionally specify attributes for the
xsl:sort
statement. Click OK.The Set Attributes dialog enables you to set attributes for the
xsl:sort
statement. Attributes control the way in which the sort is executed. For example, if you select the 'order' Attribute, you can then select ascending or descending for the sort order. Select the attributes desired for the sort.Note:
The default values for attributes are pre-selected in the Set Attributes dialog. These values are used in the absence of any selected attribute.
For instance, the default for sort order is ascending. You do not have to explicitly select 'order' Attribute to turn on ascending order.
The
xsl:sort
statement is added just below thexsl:for-each
statement and before any other nodes under the for-each. -
To set the element to sort with, drag and drop a node from under the source node-set to the xsl:sort node. For instance, to sort on USPrice, drag the USPrice node from under the node-set element Item to the xsl:sort node, as shown in Figure 41-23.
Figure 41-23 Connecting the Source Node-Set to the xsl:sort Node
Description of "Figure 41-23 Connecting the Source Node-Set to the xsl:sort Node"