Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

ElemNumber.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(XALAN_ELEMNUMBER_HEADER_GUARD)
17 #define XALAN_ELEMNUMBER_HEADER_GUARD
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 // Base class header file.
32 
33 
34 
36 
37 
38 
42 
43 
44 
45 XALAN_CPP_NAMESPACE_BEGIN
46 
47 
48 
49 class AVT;
50 class MutableNodeRefList;
51 class XalanNumberFormat;
52 class XPath;
54 
55 
56 
58 {
59 public:
60 
62 
63  enum eLevel
64  {
68  };
69 
71 
75  static void
76  initialize(MemoryManagerType& theManager);
77 
81  static void
82  terminate();
83 
94  ElemNumber(
95  StylesheetConstructionContext& constructionContext,
96  Stylesheet& stylesheetTree,
97  const AttributeListType& atts,
98  int lineNumber,
99  int columnNumber,
100  unsigned long id);
101 
102  static ElemNumber*
103  create(
104  MemoryManagerType& theManager,
105  StylesheetConstructionContext& constructionContext,
106  Stylesheet& stylesheetTree,
107  const AttributeListType& atts,
108  int lineNumber,
109  int columnNumber,
110  unsigned long id);
111 
112  virtual
113  ~ElemNumber();
114 
115  // These methods are inherited from ElemTemplateElement ...
116 
117  virtual const XalanDOMString&
118  getElementName() const;
119 
120 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
121  virtual const ElemTemplateElement*
122  startElement(StylesheetExecutionContext& executionContext) const;
123 #else
124  virtual void
125  execute(StylesheetExecutionContext& executionContext) const;
126 #endif
127 
128  unsigned long
129  getID() const
130  {
131  return m_id;
132  }
133 
138  StylesheetExecutionContext& executionContext,
139  XalanNode* pos) const;
140 
145  StylesheetExecutionContext& executionContext,
146  XalanNode* sourceNode) const;
147 
148  virtual const XPath*
149  getXPath(unsigned int index = 0) const;
150 
151 protected:
152 
164  XalanNode*
165  findAncestor(
166  StylesheetExecutionContext& executionContext,
167  const XPath* fromMatchPattern,
168  const XPath* countMatchPattern,
169  XalanNode* context) const;
170 
182  XalanNode*
184  StylesheetExecutionContext& executionContext,
185  const XPath* fromMatchPattern,
186  const XPath* countMatchPattern,
187  XalanNode* context) const;
188 
192  const XPath*
194  StylesheetExecutionContext& executionContext,
195  XalanNode* contextNode) const;
196 
201  void
203  StylesheetExecutionContext& executionContext,
204  XalanDOMString& theResult) const;
205 
206  void
208  StylesheetExecutionContext& executionContext,
209  const MutableNodeRefList& ancestors,
210  CountersTable& ctable,
211  CountType numberList[],
212  NodeRefListBase::size_type numberListLength,
213  XalanDOMString& theResult) const;
214 
225  void
227  StylesheetExecutionContext& executionContext,
228  XalanNode* node,
229  bool stopAtFirstFound,
230  MutableNodeRefList& ancestors) const;
231 
238  getNumberFormatter(StylesheetExecutionContext& executionContext) const;
239 
248  void
250  StylesheetExecutionContext& executionContext,
251  const CountType theList[],
252  NodeRefListBase::size_type theListLength,
253  XalanDOMString& formattedNumber) const;
254 
266  static void
268  CountType val,
269  const XalanDOMString& table,
270  XalanDOMString& theResult);
271 
284  static void
286  CountType val,
287  const XalanDOMChar table[],
289  XalanDOMString& theResult);
290 
299  static void
300  toRoman(
301  CountType val,
302  bool prefixesAreOK,
303  XalanDOMString& theResult);
304 
305 private:
306 
307  void
308  evaluateLetterValueAVT(
309  StylesheetExecutionContext& executionContext,
310  XalanDOMString& value) const;
311 
312  void
313  traditionalAlphaCount(
314  CountType theValue,
315  const XalanNumberingResourceBundle& theResourceBundle,
316  XalanDOMString& theResult) const;
317 
318  /*
319  * Get Formatted number
320  */
321  void
322  getFormattedNumber(
323  StylesheetExecutionContext& executionContext,
324  XalanDOMChar numberType,
325  XalanDOMString::size_type numberWidth,
326  CountType listElement,
327  XalanDOMString& theResult) const;
328 
329  const XPath* m_countMatchPattern;
330  const XPath* m_fromMatchPattern;
331  const XPath* m_valueExpr;
332 
333  CountType m_level; // = Constants.NUMBERLEVEL_SINGLE;
334 
335  const AVT* m_format_avt;
336  const AVT* m_lang_avt;
337  const AVT* m_lettervalue_avt;
338  const AVT* m_groupingSeparator_avt;
339  const AVT* m_groupingSize_avt;
340 
341  const unsigned long m_id;
342 
346  static const XalanDOMChar s_atString[];
347 
351  static const XalanDOMString& s_textString;
352 
356  static const XalanDOMString& s_commentString;
357 
361  static const XalanDOMString& s_slashString;
362 
366  static const XalanDOMChar s_piString[];
367 
371  static const XalanDOMChar s_levelString[];
372 
376  static const XalanDOMChar s_multipleString[];
377 
381  static const XalanDOMChar s_anyString[];
382 
386  static const XalanDOMChar s_singleString[];
387 
391  static const XalanDOMChar s_alphabeticString[];
392 
396  static const XalanDOMChar s_traditionalString[];
397 
401  static const XalanDOMChar s_errorString[];
402 
406  static const XalanDOMChar s_alphaCountTable[];
407 
408  static const XalanDOMString::size_type s_alphaCountTableSize;
409 
410  static const XalanDOMChar s_elalphaCountTable[];
411 
412  static const XalanDOMString::size_type s_elalphaCountTableSize;
413 
419  static const DecimalToRoman s_romanConvertTable[];
420 
421  static const size_t s_romanConvertTableSize;
425  static const XalanNumberingResourceBundle& s_elalphaResourceBundle;
426 
427 
428 public:
429 
435  {
436  public:
437 
439 
446 
452  void
453  setString(const XalanDOMString& theString);
454 
458  void
460  {
461  m_currentPosition = 0;
462  }
463 
464 
470  void
471  nextToken(XalanDOMString& theToken);
472 
478  bool
480  {
481  return m_currentPosition >= m_maxPosition ? false : true;
482  }
483 
489  size_type
490  countTokens() const;
491 
492  private:
493 
494  size_type m_currentPosition;
495 
496  size_type m_maxPosition;
497 
498  const XalanDOMString* m_string;
499  };
500 
501 private:
502 };
503 
504 
505 
506 XALAN_CPP_NAMESPACE_END
507 
508 
509 
510 #endif // XALAN_ELEMNUMBER_HEADER_GUARD

Interpreting class diagrams

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

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo