Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

FormatterToSourceTree.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(FORMATTERTOSOURCETREE_HEADER_GUARD_1357924680)
17 #define FORMATTERTOSOURCETREE_HEADER_GUARD_1357924680
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 
39 XALAN_CPP_NAMESPACE_BEGIN
40 
41 
42 
43 class PrefixResolver;
44 class XalanNode;
48 
49 
50 
56 {
57 public:
58 
61 
62  enum { eDefaultStackSize = 50, eDefaultTextBufferSize = 100 };
63 
67  static void
68  initialize(MemoryManagerType& theManager);
69 
73  static void
74  terminate();
75 
76 
83  explicit
85  XalanSourceTreeDocument* theDocument = 0);
86 
95  XalanSourceTreeDocument* theDocument,
96  XalanSourceTreeDocumentFragment* theDocumentFragment,
98 
99  virtual
101 
102 
104  getDocument() const
105  {
106  return m_document;
107  }
108 
109  void
111  {
112  m_document = theDocument;
113  }
114 
117  {
118  return m_documentFragment;
119  }
120 
121  void
123  {
124  m_documentFragment = theDocumentFragment;
125  }
126 
129  {
130  return m_currentElement;
131  }
132 
133  void
135  {
136  m_currentElement = theElement;
137  }
138 
139  // These methods are inherited from DocumentHandler ...
140 
141  virtual void
143  const XMLCh* const chars,
144  const unsigned int length);
145 
146  virtual void
147  comment(const XMLCh* const data);
148 
149  virtual void
150  cdata(
151  const XMLCh* const ch,
152  const unsigned int length);
153 
154  virtual void
155  entityReference(const XMLCh* const name);
156 
157  virtual void
158  setDocumentLocator(const LocatorType* const locator);
159 
160  virtual void
161  startDocument();
162 
163  virtual void
164  endDocument();
165 
166  virtual void
167  startElement(
168  const XMLCh* const name,
169  AttributeListType& attrs);
170 
171  virtual void
172  endElement(const XMLCh* const name);
173 
174  virtual void
175  characters(
176  const XMLCh* const chars,
177  const unsigned int length);
178 
179  virtual void
181  const XMLCh* const chars,
182  const unsigned int length);
183 
184  virtual void
186  const XMLCh* const target,
187  const XMLCh* const data);
188 
189  virtual void
190  resetDocument();
191 
192 private:
193 
194  // Some utility functions...
195  void
196  processAccumulatedText();
197 
199  createElementNode(
200  const XalanDOMChar* name,
201  AttributeListType& attrs,
202  XalanSourceTreeElement* theParentElement);
203 
204  void
205  doCharacters(
206  const XalanDOMChar* chars,
208 
209  void
210  doProcessingInstruction(
211  const XalanDOMChar* target,
212  const XalanDOMChar* data);
213 
214 
215  // Data members...
216  XalanSourceTreeDocument* m_document;
217 
218  XalanSourceTreeDocumentFragment* m_documentFragment;
219 
220  XalanSourceTreeElement* m_currentElement;
221 
222  ElementStackType m_elementStack;
223 
224  // The last child appended to the current element. This is
225  // an important optimization, because XalanSourceTreeElement
226  // does not have a pointer to it's last child. Without this,
227  // appending a child becomes a linear search.
228  XalanNode* m_lastChild;
229 
230  // Stack of last children appended. There is a one-to-one
231  // correspondance to the entries in m_elementStack.
232  LastChildStackType m_lastChildStack;
233 
234  XalanDOMString m_textBuffer;
235 };
236 
237 
238 
239 XALAN_CPP_NAMESPACE_END
240 
241 
242 
243 #endif // FORMATTERTOSOURCETREE_HEADER_GUARD_1357924680

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