Xalan-C++ API Documentation

The Xalan-C++ XSL Transformer Version 1.0

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ElemNumber Class Reference

#include <ElemNumber.hpp>

Inheritance diagram for ElemNumber:

ElemTemplateElement XalanElement PrefixResolver XalanNode Collaboration diagram for ElemNumber:

List of all members.

Public Types

Public Methods

Static Public Methods

Protected Methods

Static Protected Methods

Friends


Detailed Description


Member Typedef Documentation

typedef std::vector<Counter> ElemNumber::CounterVectorType

typedef std::vector<DecimalToRoman> ElemNumber::DecimalToRomanVectorType

typedef std::map<const ElemNumber*, CounterVectorType> ElemNumber::ElemToCounterVectorMapType

typedef std::vector<int> ElemNumber::IntArrayType

typedef std::map<XalanDOMChar, XalanNumberingResourceBundle> ElemNumber::NumberingResourceBundleMapType


Constructor & Destructor Documentation

ElemNumber::ElemNumber ( StylesheetConstructionContext & constructionContext,
Stylesheet & stylesheetTree,
const XalanDOMString & name,
const AttributeList & atts,
int lineNumber,
int columnNumber)

Construct an object corresponding to an "xsl:number" element.

Parameters:
constructionContext   context for construction of object
stylesheetTree   stylesheet containing element
name   name of element
atts   list of attributes for element
lineNumber   line number in document
columnNumber   column number in document

virtual ElemNumber::~ElemNumber () [virtual]


Member Function Documentation

virtual void ElemNumber::execute ( StylesheetExecutionContext & executionContext,
XalanNode * sourceTree,
XalanNode * sourceNode,
const QName & mode) const [virtual]

Execute the element's primary function.

Subclasses of this function may recursively execute down the element tree.

Parameters:
executionContext   The current execution context
sourceTree   input source tree
sourceNode   current context node
mode   current mode

Reimplemented from ElemTemplateElement.

XalanNode * ElemNumber::findAncestor ( StylesheetExecutionContext & executionContext,
const XPath * fromMatchPattern,
const XPath * countMatchPattern,
XalanNode * context,
const XalanElement * namespaceContext) const [protected]

Given a 'from' pattern (ala xsl:number), a match pattern and a context, find the first ancestor that matches the pattern (including the context handed in).

Parameters:
matchPatternString   The match pattern.
node   The node that "." expresses.
namespaceContext   The context in which namespaces in the queries are supposed to be expanded.

XalanNode * ElemNumber::findPrecedingOrAncestorOrSelf ( StylesheetExecutionContext & executionContext,
const XPath * fromMatchPattern,
const XPath * countMatchPattern,
XalanNode * context,
const XalanElement * namespaceContext) const [protected]

Given a 'from' pattern (ala xsl:number), a match pattern and a context, find the first ancestor that matches the pattern (including the context handed in).

Parameters:
matchPatternString   The match pattern.
node   The node that "." expresses.
namespaceContext   The context in which namespaces in the queries are supposed to be expanded.

XalanDOMString ElemNumber::formatNumberList ( StylesheetExecutionContext & executionContext,
const IntArrayType & theList,
XalanNode * contextNode) const [protected]

Format a vector of numbers into a formatted string.

Parameters:
executionContext   The current execution context.
xslNumberElement   Element that takes conversion-atts; attributes.
list   Array of one or more integer numbers.
Returns:
String that represents list according to conversion-atts; attributes. TODO: Optimize formatNumberList so that it caches the last count and reuses that info for the next count.

const XPath * ElemNumber::getCountMatchPattern ( StylesheetExecutionContext & executionContext,
XalanNode * contextNode) const [protected]

Get the count match pattern, or a default value.

XalanDOMString ElemNumber::getCountString ( StylesheetExecutionContext & executionContext,
XalanNode * sourceTree,
XalanNode * sourceNode) const [protected]

Given an XML source node, get the count according to the parameters set up by the xsl:number attributes.

MutableNodeRefList ElemNumber::getMatchingAncestors ( StylesheetExecutionContext & executionContext,
XalanNode * node,
bool stopAtFirstFound) const [protected]

Get the ancestors, up to the root, that match the pattern.

Parameters:
patterns   if non-0, count only nodes that match this pattern, if 0 count all ancestors.
node   Count this node and it's ancestors.
Returns:
The number of ancestors that match the pattern.

XalanNumberFormat * ElemNumber::getNumberFormatter ( StylesheetExecutionContext & executionContext,
XalanNode * contextNode) const [protected]

Get a formatter.

Parameters:
executionContext   The current execution context.
contextNode   The current context node.
Returns:
A new XalanNumberFormat instance. The caller owns the memory.

XalanNode * ElemNumber::getPreviousNode ( StylesheetExecutionContext & executionContext,
XalanNode * pos) const [protected]

Get the previous node to be counted.

XalanNode * ElemNumber::getTargetNode ( StylesheetExecutionContext & executionContext,
XalanNode * sourceNode) const [protected]

Get the target node that will be counted..

void ElemNumber::initialize () [static]

Perform static initialization.

See class XSLTInit.

XalanDOMString ElemNumber::int2alphaCount ( int val,
const XalanDOMString & table) [static, protected]

Convert a long integer into alphabetic counting, in other words count using the sequence A B C ...

Z AA AB AC.... etc.

Parameters:
val   Value to convert -- must be greater than zero.
table   a table containing one character for each digit in the radix
Returns:
String representing alpha count of number.
See also:
XSLTEngineImpl::DecimalToRoman

Note that the radix of the conversion is inferred from the size of the table.

XalanDOMString ElemNumber::int2singlealphaCount ( int val,
const XalanDOMString & table) [protected]

Convert a long integer into alphabetic counting, in other words count using the sequence A B C ...

Z.

Parameters:
val   Value to convert -- must be greater than zero.
table   a table containing one character for each digit in the radix
Returns:
String representing alpha count of number.
See also:
XSLTEngineImpl::DecimalToRoman

Note that the radix of the conversion is inferred from the size of the table.

XalanDOMString ElemNumber::long2roman ( long val,
bool prefixesAreOK) [static, protected]

Convert a long integer into roman numerals.

Parameters:
val   Value to convert.
prefixesAreOK   true_ to enable prefix notation (e.g. 4 = "IV"), false_ to disable prefix notation (e.g. 4 = "IIII").
Returns:
Roman numeral string.
See also:
DecimalToRoman , m_romanConvertTable

void ElemNumber::terminate () [static]

Perform static shut down.

See class XSLTInit.

XalanDOMString ElemNumber::tradAlphaCount ( int val) [static, protected]

Convert a long integer into traditional alphabetic counting, in other words count using the traditional numbering.

Parameters:
val   Value to convert -- must be greater than zero.
table   a table containing one character for each digit in the radix
Returns:
String representing alpha count of number.
See also:
XSLProcessor::DecimalToRoman

Note that the radix of the conversion is inferred from the size of the table.

Friends And Related Function Documentation

struct Counter [friend]

class CountersTable [friend]


The documentation for this class was generated from the following file:

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSL Transformer Version 1.0
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.