com.novell.xsl.process
Class ApplyTemplatesTemplate

java.lang.Object
  extended bycom.novell.xsl.process.ApplyTemplatesTemplate
All Implemented Interfaces:
Template

public class ApplyTemplatesTemplate
extends Object
implements Template

A template that processes either the nodes selected by a pattern or the immediate children of the current node. This template corresponds to the xsl:apply-templates element.


Constructor Summary
ApplyTemplatesTemplate(Expression select, Mode mode, SortCriteria sortCriteria, Template[] params, Node nsContext)
          Constructs a new ApplyTemplatesTemplate for the specified select pattern, mode, and sort criteria.
ApplyTemplatesTemplate(Mode mode, Node nsContext)
          Constructs a new ApplyTemplatesTemplate for the specified mode.
 
Method Summary
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 Mode getMode()
          Returns the mode in which this template processes the selected nodes.
 Node getNamespaceContext()
          Return the node that is the namespace context for this template
 Expression getSelect()
          Returns this template's select expression
 SortCriteria getSortCriteria()
          Returns this template's sort criteria.
 void instantiate(ProcessingEnv env, Node currentNode, ResultHandler result)
          Instantiates this template for the specified current node and sends the result to the specified result handler.
 void setMode(Mode mode)
          Set the mode to apply templates with This should only be used by BuiltInTemplateRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplyTemplatesTemplate

public ApplyTemplatesTemplate(Mode mode,
                              Node nsContext)
Constructs a new ApplyTemplatesTemplate for the specified mode. Equivalent to ApplyTemplatesTemplate(null, mode, null).

Parameters:
mode - the mode in which the template processes the selected nodes
nsContext - The namespace context node from the stylesheet

ApplyTemplatesTemplate

public ApplyTemplatesTemplate(Expression select,
                              Mode mode,
                              SortCriteria sortCriteria,
                              Template[] params,
                              Node nsContext)
Constructs a new ApplyTemplatesTemplate for the specified select pattern, mode, and sort criteria.

Parameters:
select - the template's select pattern, or null if immediate children including character data are to be processed
mode - the mode in which the template processes the selected nodes
sortCriteria - the template's sort criteria, or null if no sorting is to be performed
params - the xsl:with-param templates, or null if no params
nsContext - The namespace context node from the stylesheet
Method Detail

getSelect

public Expression getSelect()
Returns this template's select expression

Returns:
this template's select expression, or null if immediate children including character data are to be processed

getMode

public Mode getMode()
Returns the mode in which this template processes the selected nodes.

Returns:
the mode in which this template processes the selected nodes

getSortCriteria

public SortCriteria getSortCriteria()
Returns this template's sort criteria.

Returns:
this template's sort criteria, or null if no sorting is to be performed

setMode

public void setMode(Mode mode)
Set the mode to apply templates with This should only be used by BuiltInTemplateRule

Parameters:
mode - The mode to use

instantiate

public void instantiate(ProcessingEnv env,
                        Node currentNode,
                        ResultHandler result)
                 throws XSLException
Instantiates this template for the specified current node and sends the result to the specified result handler.

For an ApplyTemplatesTemplate, this method processes the nodes selected by this template's pattern. If this template has no pattern, it processes the current node's children.

Specified by:
instantiate in interface Template
Parameters:
env - the current processing environment
currentNode - the current source node
result - the handler to which results are sent
Throws:
XSLException - if a fatal error occurs during instantiation

getNamespaceContext

public Node getNamespaceContext()
Return the node that is the namespace context for this template

Specified by:
getNamespaceContext in interface Template
Returns:
The namespace context node.

dump

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

Specified by:
dump in interface Template
Parameters:
out - the output stream to write to
indent - number of tabs to indent