Package org.exolab.adaptx.xslt
Class XSLNumber
java.lang.Object
org.exolab.adaptx.xslt.XSLObject
org.exolab.adaptx.xslt.XSLNumber
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)
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 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
-
Field Summary
Fields inherited from class org.exolab.adaptx.xslt.XSLObject
APPLY_IMPORTS, APPLY_TEMPLATES, ARG, ATTRIBUTE, ATTRIBUTE_SET, CALL_TEMPLATE, CDATA, CHOOSE, COMMENT, CONTENTS, COPY, COPY_OF, ELEMENT, ENTITY_REF, FOR_EACH, FUNCTIONS, ID, IF, IMPORT, INCLUDE, KEY, LITERAL, LOCALE, MESSAGE, NUMBER, OTHERWISE, OUTPUT, PARAM, PI, PRESERVE_SPACE, SCRIPT, SORT, STRIP_SPACE, STYLESHEET, TEMPLATE, TEXT, VALUE_OF, VARIABLE, WHEN, WITH_PARAM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]
doNumbering
(XPathNode node, ProcessorState ps) Performs the numbering of the given XPathNodegetFormattedNumber
(XPathNode node, ProcessorState ps) Performs the numbering of the given XPathNode and returns the number using the format of this XSLNumber.void
setAttribute
(String name, String value) Sets the attribute with the given name to the given value.void
setCountAttr
(String count) Sets the count expression of this XSLNumbervoid
setFormatAttr
(String format) Sets the format pattern of this XSLNumbervoid
setFromAttr
(String from) void
Sets the level of numbering for this XSLNumberMethods inherited from class org.exolab.adaptx.xslt.XSLObject
addNamespaceDecl, appendAction, appendText, appendText, getActions, getAttribute, getAttributes, getNamespace, getNearestAncestor, getNodeValue, getStylesheet, getText, getType, getTypeFromName, getTypeName, resolveNamespace, setAllowActions, setNamespace, setTypeName
-
Constructor Details
-
XSLNumber
public XSLNumber()Creates a new XSLNumber Object
-
-
Method Details
-
doNumbering
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.
- Throws:
XPathException
-
getFormattedNumber
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
Description copied from class:XSLObject
Sets the attribute with the given name to the given value.- Overrides:
setAttribute
in classXSLObject
- Parameters:
name
- the name of the attribute to setvalue
- the value to set the attribute to- Throws:
XSLException
- if this XSLObject does not allow attributes with the given name, or if the attribute is read only- See Also:
-
setCountAttr
Sets the count expression of this XSLNumber- Parameters:
count
- the String value to use as the count expr expression of this XSLNumber
-
setFormatAttr
Sets the format pattern of this XSLNumber- Parameters:
format
- the Number Format to use
-
setFromAttr
-
setLevel
Sets the level of numbering for this XSLNumber- Parameters:
level
- the desired level.Levels are "single", "multi", or "any"
-