net.sf.saxon
Class Controller

java.lang.Object
  extended by javax.xml.transform.Transformer
      extended by net.sf.saxon.Controller
Direct Known Subclasses:
IdentityTransformer

public class Controller
extends Transformer

Controller processes an XML file, calling registered node handlers when appropriate to process its elements, character content, and attributes. This is Saxon's implementation of the JAXP Transformer class

Author:
Michael H. Kay (michael.h.kay@ntlworld.com)

Constructor Summary
Controller(Configuration config)
          Create a Controller and initialise variables.
 
Method Summary
 void addTraceListener(TraceListener trace)
          Adds the specified trace listener to receive trace events from this instance.
 void applyImports(int min, int max, ParameterSet params, ParameterSet tunnelParams)
          Apply a template imported from the stylesheet containing the current template.
 TailCall applyTemplates(SequenceIterator iterator, Mode mode, ParameterSet parameters, ParameterSet tunnelParameters)
          Process selected nodes using the handlers registered for a particular mode.
 void changeOutputDestination(Properties props, Result result, boolean isFinal, int validation, SchemaType schemaType)
          Set a new output destination, supplying the output format details.
 void changeToSequenceOutputDestination(SequenceReceiver out)
          Set the output destination to write to a sequence.
 void changeToTextOutputDestination(StringBuffer buffer)
          Set a simple StringBuffer output destination.
 void clearDocumentPool()
          Clear the document pool.
 void clearParameters()
          Reset the parameters to a null list.
 void defineGlobalParameters(Bindery bindery)
           
 Bindery getBindery()
          Get the current bindery.
 Configuration getConfiguration()
           
 GregorianCalendar getCurrentDateTime()
          Get the current date and time for this transformation.
 GroupIterator getCurrentGroupIterator()
          Get the current group collection.
 Item getCurrentItem()
          Get the current item.
 SequenceIterator getCurrentIterator()
          Get the current iterator.
 Mode getCurrentMode()
          Get the current mode.
 RegexIterator getCurrentRegexIterator()
          Get the current regex iterator.
 Template getCurrentTemplate()
          Get the current template.
 DecimalFormatManager getDecimalFormatManager()
          Get the Decimal Format Manager.
 DocumentPool getDocumentPool()
          Get the document pool.
 ErrorListener getErrorListener()
          Get the error listener.
 Executable getExecutable()
          Get the Executable object.
 KeyManager getKeyManager()
          Get the KeyManager.
 Emitter getMessageEmitter()
          Get the Emitter used for xsl:message output.
 NamePool getNamePool()
          Get the name pool in use.
 Properties getOutputProperties()
          Get the output properties for the transformation.
 String getOutputProperty(String name)
          Get the value of an output property.
 OutputURIResolver getOutputURIResolver()
          Get the output URI resolver.
 Object getParameter(String expandedName)
          Get a parameter to the transformation.
 Result getPrincipalResult()
          Get the principal result destination
 String getPrincipalResultURI()
          Get the URI of the principal result destination.
 DocumentInfo getPrincipalSourceDocument()
          Get the principal source document.
 SequenceReceiver getReceiver()
          Get the Receiver to which output is currently being written.
 int getRecoveryPolicy()
          Get the policy for handling recoverable errors.
 int getRememberedNumber(NodeInfo node)
          Get the number of a node if it is the last remembered one.
 RuleManager getRuleManager()
          Get the Rule Manager.
 URIResolver getStandardURIResolver()
          Get the fallback URI resolver.
 TraceListener getTraceListener()
          Get the TraceListener.
 URIResolver getURIResolver()
          Get the primary URI resolver.
 Object getUserData(Object node, String name)
          Get user data associated with a node.
 boolean isTracing()
          Test whether instruction execution is being traced.
 Builder makeBuilder()
          Make a builder for the selected tree model.
 void makeContext(Item item)
          Create a new context with a given node as the current node and the only node in the current node list.
 Emitter makeMessageEmitter()
          Make an Emitter to be used for xsl:message output.
 Stripper makeStripper(Builder b)
          Make a Stripper configured to implement the whitespace stripping rules.
 XPathContext newXPathContext()
          Make an XPathContext object for expression evaluation.
 void nextMatch(ParameterSet params, ParameterSet tunnelParams)
          Apply the next matching template.
 void pauseTracing(boolean pause)
          Pause or resume tracing.
 NodeInfo prepareInputTree(Source source)
          Prepare an input tree for processing.
 Result prepareNextStylesheet(String href, String baseURI, Result result)
          Prepare another stylesheet to handle the output of this one.
 void recoverableError(String message, SourceLocator location)
          Report a recoverable error.
 void recoverableError(TransformerException err)
          Report a recoverable error.
 void registerDocument(DocumentInfo doc, String systemId)
          Add a document to the document pool.
 void removeTraceListener(TraceListener trace)
          Removes the specified trace listener so that the next invocation of the render method will not send trace events to the listener.
 void resetOutputDestination(SequenceReceiver receiver)
          Close the current receiver, and revert to the previous receiver.
 void restoreContext(Object[] x)
          Restore the context.
 void run(NodeInfo node)
          Process a Document.
 Object[] saveContext()
          Save the XSLT processing context.
 void setCurrentGroupIterator(GroupIterator collection)
          Set the current group collection.
 void setCurrentIterator(SequenceIterator iterator)
          Set a new current item sequence iterator.
 void setCurrentMode(Mode mode)
          Set the current mode (for use by the built-in handlers).
 void setCurrentRegexIterator(RegexIterator currentRegexIterator)
          Set the current regex iterator
 void setCurrentTemplate(Template template)
          Set the current template.
 void setDecimalFormatManager(DecimalFormatManager manager)
          Set the Decimal Format Manager.
 void setErrorListener(ErrorListener listener)
          Set the error listener.
 void setExecutable(Executable exec)
          Associate this Controller with an Executable.
 void setGlobalContext()
          Set the context to point to the root of the principal source document as the singleton focus Note: the caller is expected to save the previous context and reset it later.
 void setInitialMode(String expandedModeName)
          Set the initial mode for the transformation.
 void setInitialTemplate(String expandedName)
          Set the initial named template to be used as the entry point
 void setLineNumbering(boolean onOrOff)
          Set line numbering (of the source document) on or off.
 void setOutputProperties(Properties properties)
          Set the output properties for the transformation.
 void setOutputProperty(String name, String value)
          Set an output property for the transformation.
 void setOutputURIResolver(OutputURIResolver resolver)
          Set the URI resolver for secondary output documents.
 void setParameter(String expandedName, Object value)
          Set a parameter for the transformation.
 void setPreparedStyleSheet(PreparedStyleSheet sheet)
          Associate this Controller with a compiled stylesheet.
 void setPrincipalSourceDocument(DocumentInfo doc)
          Set the principal source document (used for evaluating global variables)
 void setReceiver(SequenceReceiver receiver)
          Change the Receiver to which output is written
 void setRememberedNumber(NodeInfo node, int number)
          Set the last remembered node, for node numbering purposes.
 void setRuleManager(RuleManager r)
          Set the RuleManager, used to manage template rules for each mode.
 void setTreeModel(int model)
          Set the tree data model to use.
 void setURIResolver(URIResolver resolver)
          Set an object that will be used to resolve URIs used in document(), etc.
 void setUserData(Object node, String name, Object data)
          Set user data associated with a node (or any other object).
 void transform(Source source, Result result)
          Perform a transformation from a Source document to a Result document.
 void transformDocument(NodeInfo startNode, Result result)
          Render a source XML document supplied as a tree.
 
Methods inherited from class javax.xml.transform.Transformer
reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(Configuration config)
Create a Controller and initialise variables. Constructor is protected, the Controller should be created using newTransformer() in the PreparedStyleSheet class.

Parameters:
config - The Configuration used by this Controller
Method Detail

getConfiguration

public Configuration getConfiguration()

setInitialMode

public void setInitialMode(String expandedModeName)
Set the initial mode for the transformation.

Parameters:
expandedModeName - the name of the initial mode. The mode is supplied as an expanded QName, that is "localname" if there is no namespace, or "{uri}localname" otherwise

run

public void run(NodeInfo node)
         throws TransformerException
Process a Document.

This method is intended for use when performing a pure Java transformation, without a stylesheet. Where there is an XSLT stylesheet, use transformDocument() or transform() instead: those methods set up information from the stylesheet before calling run().

The process starts by calling the registered node handler to process the supplied node. Note that the same document can be processed any number of times, typically with different node handlers for each pass. The NodeInfo will typically be the root of a tree built using net.sf.saxon.event.Builder.

Parameters:
node - The node at which processing should start
Throws:
TransformerException - if the transformation fails for any reason

getPrincipalSourceDocument

public DocumentInfo getPrincipalSourceDocument()
Get the principal source document. This is the document containing the initial input node.

Returns:
the document containing the initial input node

applyTemplates

public TailCall applyTemplates(SequenceIterator iterator,
                               Mode mode,
                               ParameterSet parameters,
                               ParameterSet tunnelParameters)
                        throws TransformerException
Process selected nodes using the handlers registered for a particular mode.

Parameters:
iterator - an Iterator over the nodes to be processed, in the correct (sorted) order
mode - Identifies the processing mode. It should match the mode defined when the element handler was registered using setHandler with a mode parameter. Set this parameter to null to invoke the default mode.
parameters - A ParameterSet containing the parameters to the handler/template being invoked. Specify null if there are no parameters.
Returns:
a TailCall returned by the last template to be invoked, or null, indicating that there are no outstanding tail calls.
Throws:
TransformerException - if any dynamic error occurs

applyImports

public void applyImports(int min,
                         int max,
                         ParameterSet params,
                         ParameterSet tunnelParams)
                  throws TransformerException
Apply a template imported from the stylesheet containing the current template.

Parameters:
min - the minimum import precedence of template rules to be considered
max - the maximum import precedence of template rules to be considered
params - parameters supplied to xsl:apply-imports
tunnelParams - tunnel parameters supplied to xsl:apply-imports (directly or indirectly)
Throws:
TransformerException - if any dynamic error occurs

nextMatch

public void nextMatch(ParameterSet params,
                      ParameterSet tunnelParams)
               throws TransformerException
Apply the next matching template.

Parameters:
params - parameters supplied to the xsl:next-match instruction
tunnelParams - tunnel parameters supplied to xsl:apply-imports (directly or indirectly)
Throws:
TransformerException

setOutputProperties

public void setOutputProperties(Properties properties)
Set the output properties for the transformation. These properties will override properties set in the templates with xsl:output.

Specified by:
setOutputProperties in class Transformer
Parameters:
properties - the output properties to be used for the transformation

getOutputProperties

public Properties getOutputProperties()
Get the output properties for the transformation.

Specified by:
getOutputProperties in class Transformer
Returns:
the output properties being used for the transformation, including properties defined in the stylesheet for the unnamed output format

setOutputProperty

public void setOutputProperty(String name,
                              String value)
Set an output property for the transformation.

Specified by:
setOutputProperty in class Transformer
Parameters:
name - the name of the property
value - the value of the property

getOutputProperty

public String getOutputProperty(String name)
Get the value of an output property.

Specified by:
getOutputProperty in class Transformer
Parameters:
name - the name of the requested property
Returns:
the value of the requested property
See Also:
SaxonOutputKeys

getPrincipalResultURI

public String getPrincipalResultURI()
Get the URI of the principal result destination.

Returns:
the URI, as a String

getPrincipalResult

public Result getPrincipalResult()
Get the principal result destination


changeOutputDestination

public void changeOutputDestination(Properties props,
                                    Result result,
                                    boolean isFinal,
                                    int validation,
                                    SchemaType schemaType)
                             throws TransformerException
Set a new output destination, supplying the output format details.
This affects all further output until resetOutputDestination() is called. Note that it is the caller's responsibility to close the Writer after use.

Parameters:
props - properties defining the output format
result - Details of the new output destination
isFinal - true if the destination is a final result tree (either the principal output or a secondary result tree); false if it is a temporary tree, xsl:attribute, etc.
Throws:
TransformerException - if any dynamic error occurs; and specifically, if an attempt is made to switch to a final output destination while writing a temporary tree or sequence

changeToSequenceOutputDestination

public void changeToSequenceOutputDestination(SequenceReceiver out)
                                       throws TransformerException
Set the output destination to write to a sequence.
This affects all further output until resetOutputDestination() is called.

Parameters:
out - The SequenceOutputter to be used
Throws:
TransformerException - if any dynamic error occurs

changeToTextOutputDestination

public void changeToTextOutputDestination(StringBuffer buffer)
Set a simple StringBuffer output destination. Used during calls to xsl:attribute, xsl:comment, xsl:processing-instruction

Parameters:
buffer - the StringBuffer in which the string value of the node will be assembled

setReceiver

public void setReceiver(SequenceReceiver receiver)
Change the Receiver to which output is written


getReceiver

public SequenceReceiver getReceiver()
Get the Receiver to which output is currently being written.

Returns:
the current Receiver

resetOutputDestination

public void resetOutputDestination(SequenceReceiver receiver)
                            throws TransformerException
Close the current receiver, and revert to the previous receiver.

Parameters:
receiver - The receiver to revert to
Throws:
TransformerException - if any dynamic error occurs

setInitialTemplate

public void setInitialTemplate(String expandedName)
                        throws TransformerException
Set the initial named template to be used as the entry point

Parameters:
expandedName - The expanded name of the template in {uri}local format
Throws:
TransformerException - if there is no named template with this name

makeMessageEmitter

public Emitter makeMessageEmitter()
                           throws TransformerException
Make an Emitter to be used for xsl:message output.

Returns:
The newly constructed message Emitter
Throws:
TransformerException - if any dynamic error occurs; in particular, if the registered MessageEmitter class is not an Emitter

getMessageEmitter

public Emitter getMessageEmitter()
Get the Emitter used for xsl:message output.

Returns:
the Emitter being used for xsl:message output

getRecoveryPolicy

public int getRecoveryPolicy()
Get the policy for handling recoverable errors.

Returns:
the current policy, as set by setRecoveryPolicy

setErrorListener

public void setErrorListener(ErrorListener listener)
Set the error listener.

Specified by:
setErrorListener in class Transformer
Parameters:
listener - the ErrorListener to be used

getErrorListener

public ErrorListener getErrorListener()
Get the error listener.

Specified by:
getErrorListener in class Transformer
Returns:
the ErrorListener in use

recoverableError

public void recoverableError(String message,
                             SourceLocator location)
                      throws TransformerException
Report a recoverable error.

Parameters:
message - the error message
location - the stylesheet location at which the error occurred
Throws:
TransformerException - if the error listener decides not to recover from the error

recoverableError

public void recoverableError(TransformerException err)
                      throws TransformerException
Report a recoverable error.

Parameters:
err - An exception holding information about the error
Throws:
TransformerException - if the error listener decides not to recover from the error

getExecutable

public Executable getExecutable()
Get the Executable object.

Returns:
the Executable (which represents the compiled stylesheet)

getDocumentPool

public DocumentPool getDocumentPool()
Get the document pool. This is used only for source documents, not for stylesheet modules

Returns:
the source document pool

clearDocumentPool

public void clearDocumentPool()
Clear the document pool. This is sometimes useful when using the same Transformer for a sequence of transformations, but it isn't done automatically, because when the transformations use common look-up documents, the caching is beneficial.


setLineNumbering

public void setLineNumbering(boolean onOrOff)
Set line numbering (of the source document) on or off.

Parameters:
onOrOff - true to switch line numbering on; false to switch it off

makeContext

public void makeContext(Item item)
Create a new context with a given node as the current node and the only node in the current node list.

Parameters:
item - the item that is to become the context item

setPrincipalSourceDocument

public void setPrincipalSourceDocument(DocumentInfo doc)
Set the principal source document (used for evaluating global variables)


saveContext

public Object[] saveContext()
Save the XSLT processing context. This function returns a value which can be subsequently supplied to restoreContext() to restore the processing context.

Returns:
An array of objects containing the context information. This can be passed to restoreContext to reset the context.

restoreContext

public void restoreContext(Object[] x)
Restore the context. The supplied value must have been previously obtained using restoreContext().

Parameters:
x - An array of objects holding the saved context from a previous call of saveContext()

setGlobalContext

public void setGlobalContext()
Set the context to point to the root of the principal source document as the singleton focus Note: the caller is expected to save the previous context and reset it later.


getBindery

public Bindery getBindery()
Get the current bindery.

Returns:
the Bindery (in which values of all variables are held)

setURIResolver

public void setURIResolver(URIResolver resolver)
Set an object that will be used to resolve URIs used in document(), etc.

Specified by:
setURIResolver in class Transformer
Parameters:
resolver - An object that implements the URIResolver interface, or null.

getURIResolver

public URIResolver getURIResolver()
Get the primary URI resolver.

Specified by:
getURIResolver in class Transformer
Returns:
the user-supplied URI resolver if there is one, or the system-defined one otherwise (Note, this isn't quite as JAXP specifies it).

getStandardURIResolver

public URIResolver getStandardURIResolver()
Get the fallback URI resolver.

Returns:
the the system-defined URIResolver

setOutputURIResolver

public void setOutputURIResolver(OutputURIResolver resolver)
Set the URI resolver for secondary output documents.

Parameters:
resolver - An object that implements the OutputURIResolver interface, or null.

getOutputURIResolver

public OutputURIResolver getOutputURIResolver()
Get the output URI resolver.

Returns:
the user-supplied URI resolver if there is one, or the system-defined one otherwise.

getKeyManager

public KeyManager getKeyManager()
Get the KeyManager.

Returns:
the KeyManager, which holds details of all key declarations

getNamePool

public NamePool getNamePool()
Get the name pool in use.

Returns:
the name pool in use

setTreeModel

public void setTreeModel(int model)
Set the tree data model to use.

Parameters:
model - the required tree model: Builder.STANDARD_TREE or Builder.TINY_TREE
See Also:
Builder

makeBuilder

public Builder makeBuilder()
Make a builder for the selected tree model.

Returns:
an instance of the Builder for the chosen tree model

makeStripper

public Stripper makeStripper(Builder b)
Make a Stripper configured to implement the whitespace stripping rules.

Parameters:
b - the Builder to which the events filtered by this stripper are to be sent. May be null if the stripper is not being used for filtering into a Builder.
Returns:
the required stripper

registerDocument

public void registerDocument(DocumentInfo doc,
                             String systemId)
Add a document to the document pool.

Parameters:
doc - the root node of the document to be added
systemId - thesystem ID of this document

setDecimalFormatManager

public void setDecimalFormatManager(DecimalFormatManager manager)
Set the Decimal Format Manager.

Parameters:
manager - the Decimal Format Manager. This object is responsible for maintaining all named and unnamed decimal format declarations

getDecimalFormatManager

public DecimalFormatManager getDecimalFormatManager()
Get the Decimal Format Manager.

Returns:
the Decimal Format Manager

setRuleManager

public void setRuleManager(RuleManager r)
Set the RuleManager, used to manage template rules for each mode.

Parameters:
r - the Rule Manager

getRuleManager

public RuleManager getRuleManager()
Get the Rule Manager.

Returns:
the Rule Manager, used to hold details of template rules for all modes

getTraceListener

public TraceListener getTraceListener()
Get the TraceListener.

Returns:
the TraceListener used for XSLT instruction tracing

isTracing

public final boolean isTracing()
Test whether instruction execution is being traced.

Returns:
true if tracing is active, false otherwise

pauseTracing

public final void pauseTracing(boolean pause)
Pause or resume tracing.

Parameters:
pause - true if tracing is to pause; false if it is to resume

addTraceListener

public void addTraceListener(TraceListener trace)
Adds the specified trace listener to receive trace events from this instance. Must be called before the invocation of the render method.

Parameters:
trace - the trace listener.

removeTraceListener

public void removeTraceListener(TraceListener trace)
Removes the specified trace listener so that the next invocation of the render method will not send trace events to the listener.

Parameters:
trace - the trace listener.

setPreparedStyleSheet

public void setPreparedStyleSheet(PreparedStyleSheet sheet)
Associate this Controller with a compiled stylesheet.

Parameters:
sheet - the compiled stylesheet

setExecutable

public void setExecutable(Executable exec)
Associate this Controller with an Executable. This method is used by the XQuery processor. The Executable object is overkill in this case - the only thing it currently holds are copies of the collation table.


defineGlobalParameters

public void defineGlobalParameters(Bindery bindery)

getUserData

public Object getUserData(Object node,
                          String name)
Get user data associated with a node.

Parameters:
node - the node to which the data is attached
name - the name of the required property
Returns:
the value of the required property

setUserData

public void setUserData(Object node,
                        String name,
                        Object data)
Set user data associated with a node (or any other object).

Parameters:
node -
name -
data -

transform

public void transform(Source source,
                      Result result)
               throws TransformerException
Perform a transformation from a Source document to a Result document.

Specified by:
transform in class Transformer
Parameters:
source - The input for the source tree. May be null if and only if an initial template has been supplied.
result - The destination for the result tree.
Throws:
TransformerException - if the transformation fails. As a special case, the method throws a TerminationException (a subclass of TransformerException) if the transformation was terminated using xsl:message terminate="yes".

prepareInputTree

public NodeInfo prepareInputTree(Source source)
Prepare an input tree for processing. This is used when either the initial input, or a Source returned by the document() function, is a NodeInfo or a DOMSource. The preparation consists of wrapping a DOM document inside a wrapper that implements the NodeInfo interface, and/or adding a space-stripping wrapper if the stylesheet strips whitespace nodes.

Parameters:
source - the input tree. Must be either a DOMSource or a NodeInfo
Returns:
the NodeInfo representing the input node, suitably wrapped.

transformDocument

public void transformDocument(NodeInfo startNode,
                              Result result)
                       throws TransformerException
Render a source XML document supplied as a tree.
A new output destination should be created for each source document, by using setOutputDetails().

Parameters:
startNode - A Node that identifies the source document to be transformed and the node where the transformation should start. May be null if the transformation is to start using an initial template.
result - The output destination
Throws:
TransformerException - if any dynamic error occurs

prepareNextStylesheet

public Result prepareNextStylesheet(String href,
                                    String baseURI,
                                    Result result)
                             throws TransformerException
Prepare another stylesheet to handle the output of this one.

Parameters:
href - URI of the next stylesheet to be applied
baseURI - base URI for resolving href if it's a relative URI
result - the output destination of the current stylesheet
Returns:
a replacement destination for the current stylesheet
Throws:
TransformerException - if any dynamic error occurs

setParameter

public void setParameter(String expandedName,
                         Object value)
Set a parameter for the transformation.

Specified by:
setParameter in class Transformer
Parameters:
expandedName - The name of the parameter in {uri}local format
value - The value object. This can be any valid Java object it follows the same conversion rules as a value returned from a Saxon extension function.

clearParameters

public void clearParameters()
Reset the parameters to a null list.

Specified by:
clearParameters in class Transformer

getParameter

public Object getParameter(String expandedName)
Get a parameter to the transformation.

Specified by:
getParameter in class Transformer
Parameters:
expandedName - the name of the required parameter, in "{uri}local-name" format
Returns:
the value of the parameter, if it exists, or null otherwise

getCurrentDateTime

public GregorianCalendar getCurrentDateTime()
Get the current date and time for this transformation. All calls during one transformation return the same answer.

Returns:
Get the current date and time. This will deliver the same value for repeated calls within the same transformation

setCurrentMode

public void setCurrentMode(Mode mode)
Set the current mode (for use by the built-in handlers). The caller is responsible for saving the previous current mode and resetting it after use.

Parameters:
mode - the new current mode

getCurrentMode

public Mode getCurrentMode()
Get the current mode. (For use by the built-in handlers, and when tracing)

Returns:
the current mode

setCurrentIterator

public void setCurrentIterator(SequenceIterator iterator)
Set a new current item sequence iterator. The caller is responsible for remembering the previous current iterator and resetting it after use.

Parameters:
iterator - The current sequence iterator. May be null, which causes the context item, position, and size to be unset.

getCurrentIterator

public SequenceIterator getCurrentIterator()
Get the current iterator.

Returns:
the current iterator. Note that this may be null if there is no context item, which will be the case on entry to a stylesheet function.

getCurrentItem

public Item getCurrentItem()
                    throws XPathException
Get the current item.

Returns:
the current item (identified by the current iterator)
Throws:
XPathException - if any dynamic error occurs, for example, if there is no current item

setCurrentTemplate

public void setCurrentTemplate(Template template)
Set the current template. This is used to support xsl:apply-imports. The caller is responsible for remembering the previous current template and resetting it after use.

Parameters:
template - the current template

getCurrentTemplate

public Template getCurrentTemplate()
Get the current template. This is used to support xsl:apply-imports

Returns:
the current template

setCurrentGroupIterator

public void setCurrentGroupIterator(GroupIterator collection)
Set the current group collection. The caller is responsible for remembering and resetting the previous current group.

Parameters:
collection - the new current GroupIterator

getCurrentGroupIterator

public GroupIterator getCurrentGroupIterator()
Get the current group collection.

Returns:
the current grouped collection

setCurrentRegexIterator

public void setCurrentRegexIterator(RegexIterator currentRegexIterator)
Set the current regex iterator

Parameters:
currentRegexIterator - the current regex iterator

getCurrentRegexIterator

public RegexIterator getCurrentRegexIterator()
Get the current regex iterator.

Returns:
the current regular expresions iterator

newXPathContext

public XPathContext newXPathContext()
Make an XPathContext object for expression evaluation.

Returns:
the new XPathContext

setRememberedNumber

public void setRememberedNumber(NodeInfo node,
                                int number)
Set the last remembered node, for node numbering purposes.

Parameters:
node - the node in question
number - the number of this node

getRememberedNumber

public int getRememberedNumber(NodeInfo node)
Get the number of a node if it is the last remembered one.

Parameters:
node - the node for which remembered information is required
Returns:
the number of this node if known, else -1.