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
XalanSourceTreeDocumentFragment * getDocumentFragment() const
Definition: FormatterToSourceTree.hpp:116
#define XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR
Definition: XalanMemoryManagement.hpp:401
Definition: XalanNode.hpp:44
void setDocumentFragment(XalanSourceTreeDocumentFragment *theDocumentFragment)
Definition: FormatterToSourceTree.hpp:122
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
Definition: AttributeListImpl.hpp:39
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
virtual void startDocument()=0
virtual void setDocumentLocator(const Locator *const locator)=0
virtual void startElement(const XMLCh *const name, AttributeList &attrs)=0
virtual void ignorableWhitespace(const XMLCh *const chars, const size_type length)=0
void setDocument(XalanSourceTreeDocument *theDocument)
Definition: FormatterToSourceTree.hpp:110
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:402
virtual void resetDocument()=0
void setCurrentElement(XalanSourceTreeElement *theElement)
Definition: FormatterToSourceTree.hpp:134
virtual void charactersRaw(const XMLCh *const chars, const size_type length)=0
Receive notification of character data.
virtual void characters(const XMLCh *const chars, const size_type length)=0
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:62
virtual void endDocument()=0
Definition: XalanSourceTreeDocumentFragment.hpp:49
virtual void entityReference(const XMLCh *const name)=0
Receive notification of a entityReference.
virtual void cdata(const XMLCh *const ch, const size_type length)=0
Receive notification of cdata.
#define XALAN_XALANSOURCETREE_EXPORT
Definition: XalanSourceTreeDefinitions.hpp:33
This class defines an interface for classes that resolve namespace prefixes to their URIs...
Definition: PrefixResolver.hpp:37
virtual void endElement(const XMLCh *const name)=0
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
Definition: FormatterListener.hpp:47
XalanSourceTreeDocument * getDocument() const
Definition: FormatterToSourceTree.hpp:104
XalanVector< XalanSourceTreeElement * > ElementStackType
Definition: FormatterToSourceTree.hpp:59
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and adds t...
Definition: FormatterToSourceTree.hpp:55
XalanSourceTreeElement * getCurrentElement() const
Definition: FormatterToSourceTree.hpp:128
Definition: XalanDOMString.hpp:42
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:277
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Definition: XalanSourceTreeDocument.hpp:73
Definition: XalanSourceTreeElement.hpp:44
unsigned int size_type
Definition: XalanDOMString.hpp:53
virtual void comment(const XMLCh *const data)=0
Called when a Comment is to be constructed.
XalanVector< XalanNode * > LastChildStackType
Definition: FormatterToSourceTree.hpp:60

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