Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.novell.xsl.process
Class SingleNumberTemplate

    java.lang.Object
      com.novell.xsl.process.NumberTemplate
          com.novell.xsl.process.SingleNumberTemplate

All Implemented Interfaces:
  Template

    public class SingleNumberTemplate

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 items in a list.

See Also:
  `AnyNumberTemplate`, `MultiNumberTemplate`

Nested Class Summary

Nested classes/interfaces 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
`SingleNumberTemplate(Pattern countPattern, Pattern fromPattern, Expression formatExpr, Expression langExpr, Expression letterValueExpr, Expression digitGroupSepExpr, Expression digitsPerGroupExpr, Expression valueExpr, Node nsNode)` Constructs a single 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

### SingleNumberTemplate

    public SingleNumberTemplate(Pattern countPattern,
                                Pattern fromPattern,
                                Expression formatExpr,
                                Expression langExpr,
                                Expression letterValueExpr,
                                Expression digitGroupSepExpr,
                                Expression digitsPerGroupExpr,
                                Expression valueExpr,
                                Node nsNode)
                         throws XSLException

  Constructs a single 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
    `valueExpr` - a number expression which is evaluated to get the number that is to be formated. If `null` then the position of the current node in the source document is used.
    `nsNode` - 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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD