com.novell.xsl.process
Class CopyTemplate

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

public class CopyTemplate
extends TemplateCollection

A template that creates a copy of the current node. This template corresponds to the xsl:copy element.


Constructor Summary
CopyTemplate(Collection attributeSetNames, Template[] templates, Node nsContext)
          Constructs a CopyTemplate that copies the current node; the new node's attributes and children are given by the specified templates.
 
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.
 
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

CopyTemplate

public CopyTemplate(Collection attributeSetNames,
                    Template[] templates,
                    Node nsContext)
Constructs a CopyTemplate that copies the current node; the new node's attributes and children are given by the specified templates.

Parameters:
attributeSetNames - The attribute sets to use when the template is instantiated (may be null).
templates - the templates to be instantiated to get the new node's attributes and children
nsContext - The node in the style sheet from which this template comes
Method Detail

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 CopyTemplate, this method copies the current node and, if the current node is an element, instantiates this template's contained templates to set the copied element's attributes and children. As a special case, if the current node is a document node (i.e., the root node), this method does not copy it since that wouldn't make sense, but instead just instantiates this template's contained templates to set the document's children.

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