org.exolab.adaptx.xslt

Class XSLNumber

public class XSLNumber extends XSLObject

Represents the xsl:number element. Handles numbering in the source tree
Section 2.7.10 of the W3C XSL Working Draft 1.0 (19981216)
Section 9.7 of the W3C XSLT Working Draft 1.0 (1990421)

Version: $Revision: 3633 $ $Date: 2003-03-01 02:38:44 -0500 (Sat, 01 Mar 2003) $

Author: Keith Visco

Constructor Summary
XSLNumber()
Creates a new XSLNumber Object
Method Summary
int[]doNumbering(XPathNode node, ProcessorState ps)
Performs the numbering of the given XPathNode
StringgetFormattedNumber(XPathNode node, ProcessorState ps)
Performs the numbering of the given XPathNode and returns the number using the format of this XSLNumber.
voidsetAttribute(String name, String value)
voidsetCountAttr(String count)
Sets the count expression of this XSLNumber
voidsetFormatAttr(String format)
Sets the format pattern of this XSLNumber
voidsetFromAttr(String from)
voidsetLevel(String level)
Sets the level of numbering for this XSLNumber

Constructor Detail

XSLNumber

public XSLNumber()
Creates a new XSLNumber Object

Method Detail

doNumbering

public int[] doNumbering(XPathNode node, ProcessorState ps)
Performs the numbering of the given XPathNode

Parameters: XPathNode the XPathNode to perform numbering on. [This must be of type XPathNode.ELEMENT]

Returns: an array of integers which represent the multi-level number of the given element. Single-level numbering will return an array of size 1.

getFormattedNumber

public String getFormattedNumber(XPathNode node, ProcessorState ps)
Performs the numbering of the given XPathNode and returns the number using the format of this XSLNumber.

Parameters: node the XPathNode to get the number of. This node must be of type XPathNode.ELEMENT.

Returns: the formatted number as a String

setAttribute

public void setAttribute(String name, String value)

See Also:

setCountAttr

public void setCountAttr(String count)
Sets the count expression of this XSLNumber

Parameters: count the String value to use as the count expr expression of this XSLNumber

setFormatAttr

public void setFormatAttr(String format)
Sets the format pattern of this XSLNumber

Parameters: format the Number Format to use

setFromAttr

public void setFromAttr(String from)

setLevel

public void setLevel(String level)
Sets the level of numbering for this XSLNumber

Parameters: level the desired level.

  Levels are "single", "multi", or "any"