com.novell.xsl.process
Class MultiNumberTemplate

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

public class MultiNumberTemplate
extends NumberTemplate

A template that adds a formatted number to the result tree; the number is a count of nodes at a single level of the source tree. This template corresponds to the xsl:number element with level="single".

This template produces a multi-part formatted number such as A.1.2 that, for example, might be used for outline-style numbering.

See Also:
AnyNumberTemplate, SingleNumberTemplate

Nested Class Summary
 
Nested classes inherited from class com.novell.xsl.process.NumberTemplate
NumberTemplate.ParsedFormat
 
Field Summary
 
Fields inherited from class com.novell.xsl.process.NumberTemplate
countPattern, digitGroupSepExpr, digitsPerGroupExpr, formatExpr, fromPattern, langExpr, letterValueExpr, preparsedFormat, valueExpr
 
Constructor Summary
MultiNumberTemplate(Pattern countPattern, Pattern fromPattern, Expression formatExpr, Expression langExpr, Expression letterValueExpr, Expression digitGroupSepExpr, Expression digitsPerGroupExpr, Node nsContext)
          Constructs a multi-level number template.
 
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.NumberTemplate
getNamespaceContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiNumberTemplate

public MultiNumberTemplate(Pattern countPattern,
                           Pattern fromPattern,
                           Expression formatExpr,
                           Expression langExpr,
                           Expression letterValueExpr,
                           Expression digitGroupSepExpr,
                           Expression digitsPerGroupExpr,
                           Node nsContext)
                    throws XSLException
Constructs a multi-level number template.

Parameters:
countPattern - a match pattern specifying the nodes to be counted; null means count elements having the same type name as the current node
fromPattern - a match pattern specifying where counting starts from; null means counting starts from the beginning of the document
formatExpr - a string expression specifying how to format the numbers
langExpr - a string expression specifying the language to use for alphabetic sequences; null means determine the language from the system environment
letterValueExpr - a string expression that disambiguates between numbering schemes that use letters; must evaluate to alphabetic or traditional; what does null mean?
digitGroupSepExpr - a string expression specifying the separator between groups of digits; null means there are no digit group separators
digitsPerGroupExpr - a string expression specifying the number of digits per group; null means there are no digit group separators
nsContext - The node in the style sheet from which this template comes
Throws:
XSLException - if a fatal error occurs during construction
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 NumberTemplate, this method evaluates the template's string expressions, counts the desired nodes, formats the desired number and adds a text node containing the formatted number to the result tree.

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 NumberTemplate
Parameters:
out - the output stream to write to
indent - number of tabs to indent