com.novell.xsl.process
Class Key

java.lang.Object
  extended bycom.novell.xsl.process.Key
All Implemented Interfaces:
XPathResetCache

public class Key
extends Object
implements XPathResetCache

A class implementing the xsl:key functionality


Constructor Summary
Key(ExpandedQName name, Pattern match, Expression use, Node namespaceContext)
          Create a Key with the passed name, match pattern, and use expression
 
Method Summary
 void dump(PrintWriter writer, int indent)
          Dumps this object to the specified output stream.
 NodeSet evaluate(String value, Node contextNode, ExpressionContext context)
          Return a node set of nodes in the same document as the context node that match the match pattern of the key and that have the passed value in the location specified by the use expression of the key.
 ExpandedQName getName()
          Return the expanded name of this key
 void resetCache()
          Reset any cached information in preparation for document evaluation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Key

public Key(ExpandedQName name,
           Pattern match,
           Expression use,
           Node namespaceContext)
Create a Key with the passed name, match pattern, and use expression

Parameters:
name - The expanded name of the key
match - The match pattern of the key
use - The use expression of the key
namespaceContext - The node in the stylesheet that gives the namespace context for the pattern and expression (the xsl:key element)
Method Detail

getName

public ExpandedQName getName()
Return the expanded name of this key

Returns:
The expanded name of this key

evaluate

public NodeSet evaluate(String value,
                        Node contextNode,
                        ExpressionContext context)
                 throws XPathEvaluationException
Return a node set of nodes in the same document as the context node that match the match pattern of the key and that have the passed value in the location specified by the use expression of the key.

Parameters:
value - The value to find
contextNode - The context node specifying the document to reference
context - The expression context for evaluating the match pattern and use expression
Returns:
A node set containing all nodes in the same document as the context node that satisfy the conditions of the key
Throws:
XPathEvaluationException - If an error occurs during the evaluation of the match pattern or use expression.

resetCache

public void resetCache()
Reset any cached information in preparation for document evaluation

Specified by:
resetCache in interface XPathResetCache

dump

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

Parameters:
writer - the PrintWriter to write to
indent - the number of tabs to indent