com.novell.xsl.process
Class SortCriteria

java.lang.Object
  extended bycom.novell.xsl.process.SortCriteria

public class SortCriteria
extends Object

Criteria for sorting source nodes. This corresponds to the collection of xsl:sort elements in an xsl:apply-templates or at the beginning of an xsl:for-each.


Constructor Summary
SortCriteria(SortKey[] sortKeys, Node contextNode)
          Constructs a new SortCriteria using the specified sort keys.
 
Method Summary
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 ContextNodeList sort(ProcessingEnv env, Node currentNode, ContextNodeList nodeList)
          Uses this sort criteria to sort the specified list of source nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortCriteria

public SortCriteria(SortKey[] sortKeys,
                    Node contextNode)
Constructs a new SortCriteria using the specified sort keys.

Parameters:
sortKeys - the sort keys specifying how nodes are to be sorted; the primary key is first, the secondary key (if any) is second, etc.
Method Detail

sort

public ContextNodeList sort(ProcessingEnv env,
                            Node currentNode,
                            ContextNodeList nodeList)
                     throws XSLException
Uses this sort criteria to sort the specified list of source nodes. Note that the processing environment and current source node are needed since the sort keys contain expressions that must be evaluated at runtime.

Parameters:
env - the current processing environment
currentNode - the current source node
nodeList - the list of source nodes to be sorted
Returns:
the sorted list of nodes
Throws:
XSLException - if a fatal error occurs during sorting

dump

public void dump(PrintWriter out,
                 int indent)
Dumps this object to the specified output stream.

Parameters:
out - the output stream to write to
indent - number of tabs to indent