com.novell.xsl.process
Class AnyNumberTemplate
java.lang.Object
com.novell.xsl.process.NumberTemplate
com.novell.xsl.process.AnyNumberTemplate
- All Implemented Interfaces:
- Template
- public class AnyNumberTemplate
- 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 single formatted number such as 1.
that, for example, might be used to number the figures in a document.
- See Also:
MultiNumberTemplate
,
SingleNumberTemplate
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnyNumberTemplate
public AnyNumberTemplate(Pattern countPattern,
Pattern fromPattern,
Expression formatExpr,
Expression langExpr,
Expression letterValueExpr,
Expression digitGroupSepExpr,
Expression digitsPerGroupExpr,
Node nsContext)
throws XSLException
- Constructs an any 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 nodefromPattern
- a match pattern specifying where counting
starts from; null
means
counting starts from the beginning of the
documentformatExpr
- a string expression specifying how to format
the numberslangExpr
- a string expression specifying the language
to use for alphabetic sequences;
null
means determine the
language from the system environmentletterValueExpr
- 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 separatorsdigitsPerGroupExpr
- a string expression specifying the number of
digits per group; null
means
there are no digit group separatorsnsContext
- The node in the style sheet from which this template comes
- Throws:
XSLException
- if a fatal error occurs during construction
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 environmentcurrentNode
- the current source noderesult
- 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 toindent
- number of tabs to indent