com.novell.xsl.process
Class ForEachTemplate

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

public class ForEachTemplate
extends TemplateCollection

A template that is instantiated for each node selected by a pattern. This template corresponds to the xsl:for-each element.


Constructor Summary
ForEachTemplate(Expression select, Template[] templates, SortCriteria sortCriteria, Node nsContext)
          Constructs a ForEachTemplate for the specified select pattern, templates, and sort criteria.
 
Method Summary
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 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.
 
Methods inherited from class com.novell.xsl.process.TemplateCollection
getNamespaceContext, getTemplates, instantiateTemplates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForEachTemplate

public ForEachTemplate(Expression select,
                       Template[] templates,
                       SortCriteria sortCriteria,
                       Node nsContext)
Constructs a ForEachTemplate for the specified select pattern, templates, and sort criteria.

Parameters:
select - the select expression to be used
templates - the contained templates
sortCriteria - the template's sort criteria, or null if no sorting is to be performed
nsContext - The node in the style sheet from which this template comes
Method Detail

getSelect

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

Returns:
this template's select expression

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

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 a ForEachTemplate, this method instantiates this template's contained templates for each source node selected by this template's pattern.

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

dump

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

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