com.novell.xsl.extensions
Class AssignVariableTemplate

java.lang.Object
  extended bycom.novell.xsl.process.TemplateCollection
      extended bycom.novell.xsl.process.VariableTemplate
          extended bycom.novell.xsl.extensions.AssignVariableTemplate
All Implemented Interfaces:
Expression, Template

public class AssignVariableTemplate
extends VariableTemplate

A extension element template that allows assignment to an xsl:variable-defined variable. This represents the nxsl:assign-variable element


Field Summary
protected  Expression variable
          The variable object that this template is to modify.
 
Fields inherited from class com.novell.xsl.process.VariableTemplate
currentValue
 
Constructor Summary
protected AssignVariableTemplate(ExpandedQName name, Expression select, Template[] templates, Expression variable, Node nsContext)
          Constructs an AssignVariableTemplate that create assigns a new value to an already-defined variable
 
Method Summary
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 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.
static Template parse(StylesheetParser stylesheetParser, Element element)
          Parse an nxsl:assign-variable element (an extension element)
 
Methods inherited from class com.novell.xsl.process.VariableTemplate
evaluate, getCurrentValue, getName, getResultType, getSelect, isConstant, isParam, registerForReset, setCurrentValue
 
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
 

Field Detail

variable

protected Expression variable
The variable object that this template is to modify. Must be either a VariableTemplate object or a VariablePlaceholder object

Constructor Detail

AssignVariableTemplate

protected AssignVariableTemplate(ExpandedQName name,
                                 Expression select,
                                 Template[] templates,
                                 Expression variable,
                                 Node nsContext)
Constructs an AssignVariableTemplate that create assigns a new value to an already-defined variable

Parameters:
name - the name of the variable (an expanded name)
select - the optional expression that is evaluated to give the the value of the variable
templates - the templates to be evaluated to get the variable's value if no select expression is given
variable - the Expression-implementing object whose value this template will modify (must be either a VariableTemplate or a VariablePlaceholder object)
nsContext - The node in the style sheet from which this template comes
Method Detail

parse

public static Template parse(StylesheetParser stylesheetParser,
                             Element element)
                      throws XSLTParserException
Parse an nxsl:assign-variable element (an extension element)

Parameters:
stylesheetParser - The StylesheetParser for which the element is to be parsed.
element - The element node in the stylesheet.
Returns:
An AssignVariableTemplate object representing the nxsl:assign-variable template
Throws:
XSLTParserException

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 VariableTemplate, this method evaluates the select expression, or instantiates the result fragment template, and places the variable within scope.

Specified by:
instantiate in interface Template
Overrides:
instantiate in class VariableTemplate
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 Expression
Overrides:
dump in class VariableTemplate
Parameters:
out - the output stream to write to
indent - number of tabs to indent