Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanSourceTreeDocument.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(XALANSOURCETREEDOCUMENT_HEADER_GUARD_1357924680)
17 #define XALANSOURCETREEDOCUMENT_HEADER_GUARD_1357924680
18 
19 
20 
22 
23 
24 
27 
28 
29 
32 
33 
34 
38 
39 
40 
51 
52 
53 
54 XALAN_DECLARE_XERCES_CLASS(Attributes)
55 XALAN_DECLARE_XERCES_CLASS(AttributeList)
56 
57 
58 
59 XALAN_CPP_NAMESPACE_BEGIN
60 
61 
62 
63 typedef XERCES_CPP_NAMESPACE_QUALIFIER Attributes AttributesType;
64 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType;
65 
66 
67 
68 class PrefixResolver;
70 
71 
72 
74 {
75 public:
76 
79 
80  typedef XalanMap<
81  const XalanDOMChar*,
83 
84  typedef XalanMap<
86  XalanDOMString> UnparsedEntityURIMapType;
87 
88 
92  static void
93  initialize(MemoryManagerType& theManager);
94 
98  static void
99  terminate();
100 
101 
102  enum { eDefaultAttributeAllocatorBlockSize = 100,
103  eDefaultAttributeNSAllocatorBlockSize = 50,
104  eDefaultCommentAllocatorBlockSize = 10,
105  eDefaultElementAllocatorBlockSize = 100,
106  eDefaultElementNSAllocatorBlockSize = 100,
107  eDefaultPIAllocatorBlockSize = 10,
108  eDefaultTextAllocatorBlockSize = 100,
109  eDefaultTextIWSAllocatorBlockSize = 100,
110  eDefaultNamesStringPoolBlockSize = XalanDOMStringPool::eDefaultBlockSize,
111  eDefaultNamesStringPoolBucketCount = XalanDOMStringPool::eDefaultBucketCount,
112  eDefaultNamesStringPoolBucketSize = XalanDOMStringPool::eDefaultBucketSize,
113  eDefaultValuesStringPoolBlockSize = XalanDOMStringPool::eDefaultBlockSize,
114  eDefaultValuesStringPoolBucketCount = 997,
115  eDefaultValuesStringPoolBucketSize = XalanDOMStringPool::eDefaultBucketSize };
116 
117 
122 
137  MemoryManagerType& theManager,
138  bool fPoolAllText = s_poolAllTextNodes,
139  block_size_type theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
140  bucket_count_type theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
141  bucket_size_type theNamesStringPoolBucketSize = eDefaultNamesStringPoolBucketSize,
142  block_size_type theValuesStringPoolBlockSize = eDefaultValuesStringPoolBlockSize,
143  bucket_count_type theValuesStringPoolBucketCount = eDefaultValuesStringPoolBucketCount,
144  bucket_size_type theValuesStringPoolBucketSize = eDefaultValuesStringPoolBucketSize);
145 
146 
148  create(
149  MemoryManagerType& theManager,
150  bool fPoolAllText = s_poolAllTextNodes,
151  block_size_type theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
152  bucket_count_type theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
153  bucket_size_type theNamesStringPoolBucketSize = eDefaultNamesStringPoolBucketSize,
154  block_size_type theValuesStringPoolBlockSize = eDefaultValuesStringPoolBlockSize,
155  bucket_count_type theValuesStringPoolBucketCount = eDefaultValuesStringPoolBucketCount,
156  bucket_size_type theValuesStringPoolBucketSize = eDefaultValuesStringPoolBucketSize);
157 
173  MemoryManagerType& theManager,
174  allocator_size_type theAttributeBlockSize,
175  allocator_size_type theAttributeNSBlockSize,
176  allocator_size_type theCommentBlockSize,
177  allocator_size_type theElementBlockSize,
178  allocator_size_type theElementNSBlockSize,
179  allocator_size_type thePIBlockSize,
180  allocator_size_type theTextBlockSize,
181  allocator_size_type theTextIWSBlockSize,
182  bool fPoolAllText = s_poolAllTextNodes);
183 
184  virtual
186 
187  // These interfaces are inherited from XalanNode...
188  virtual const XalanDOMString&
189  getNodeName() const;
190 
191  virtual const XalanDOMString&
192  getNodeValue() const;
193 
194  virtual NodeType
195  getNodeType() const;
196 
197  virtual XalanNode*
198  getParentNode() const;
199 
200  virtual const XalanNodeList*
201  getChildNodes() const;
202 
203  virtual XalanNode*
204  getFirstChild() const;
205 
206  virtual XalanNode*
207  getLastChild() const;
208 
209  virtual XalanNode*
210  getPreviousSibling() const;
211 
212  virtual XalanNode*
213  getNextSibling() const;
214 
215  virtual const XalanNamedNodeMap*
216  getAttributes() const;
217 
218  virtual XalanDocument*
219  getOwnerDocument() const;
220 
221 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
222  virtual XalanNode*
223 #else
224  virtual XalanSourceTreeDocument*
225 #endif
226  cloneNode(bool deep) const;
227 
228  virtual XalanNode*
229  insertBefore(
230  XalanNode* newChild,
231  XalanNode* refChild);
232 
233  virtual XalanNode*
234  replaceChild(
235  XalanNode* newChild,
236  XalanNode* oldChild);
237 
238  virtual XalanNode*
239  removeChild(XalanNode* oldChild);
240 
241  virtual XalanNode*
242  appendChild(XalanNode* newChild);
243 
244  virtual bool
245  hasChildNodes() const;
246 
247  virtual void
248  setNodeValue(const XalanDOMString& nodeValue);
249 
250  virtual void
251  normalize();
252 
253  virtual bool
254  isSupported(
255  const XalanDOMString& feature,
256  const XalanDOMString& version) const;
257 
258  virtual const XalanDOMString&
259  getNamespaceURI() const;
260 
261  virtual const XalanDOMString&
262  getPrefix() const;
263 
264  virtual const XalanDOMString&
265  getLocalName() const;
266 
267  virtual void
268  setPrefix(const XalanDOMString& prefix);
269 
270  virtual bool
271  isIndexed() const;
272 
273  virtual IndexType
274  getIndex() const;
275 
276  virtual XalanElement*
277  createElement(const XalanDOMString& tagName);
278 
279  virtual XalanDocumentFragment*
280  createDocumentFragment();
281 
282  virtual XalanText*
283  createTextNode(const XalanDOMString& data);
284 
285  virtual XalanComment*
286  createComment(const XalanDOMString& data);
287 
288  virtual XalanCDATASection*
289  createCDATASection(const XalanDOMString& data);
290 
292  createProcessingInstruction(
293  const XalanDOMString& target,
294  const XalanDOMString& data);
295 
296  virtual XalanAttr*
297  createAttribute(const XalanDOMString& name);
298 
299  virtual XalanEntityReference*
300  createEntityReference(const XalanDOMString& name);
301 
302  virtual XalanDocumentType*
303  getDoctype() const;
304 
305  virtual XalanDOMImplementation*
306  getImplementation() const;
307 
308  virtual XalanElement*
309  getDocumentElement() const;
310 
311  virtual XalanNodeList*
312  getElementsByTagName(const XalanDOMString& tagname) const;
313 
314  virtual XalanNode*
315  importNode(
316  XalanNode* importedNode,
317  bool deep);
318 
319  virtual XalanElement*
320  createElementNS(
321  const XalanDOMString& namespaceURI,
322  const XalanDOMString& qualifiedName);
323 
324  virtual XalanAttr*
325  createAttributeNS(
326  const XalanDOMString& namespaceURI,
327  const XalanDOMString& qualifiedName);
328 
329  virtual XalanNodeList*
330  getElementsByTagNameNS(
331  const XalanDOMString& namespaceURI,
332  const XalanDOMString& localName) const;
333 
334  virtual XalanElement*
335  getElementById(const XalanDOMString& elementId) const;
336 
337 
338  // Interfaces not inherited from XalanDocument...
339 
340  static bool
341  getPoolAllTextNodes()
342  {
343  return s_poolAllTextNodes;
344  }
345 
346  static void
347  setPoolAllTextNodes(bool fPool)
348  {
349  s_poolAllTextNodes = fPool;
350  }
351 
352 
354  createElementNode(
355  const XalanDOMChar* name,
356  const AttributeListType& attrs,
357  XalanNode* theParentNode = 0,
358  XalanNode* thePreviousSibling = 0,
359  XalanNode* theNextSibling = 0,
360  bool fAddXMLNamespaceAttribute = false);
361 
363  createElementNode(
364  const XalanDOMChar* uri,
365  const XalanDOMChar* localname,
366  const XalanDOMChar* qname,
367  const AttributesType& attrs,
368  XalanNode* theParentNode = 0,
369  XalanNode* thePreviousSibling = 0,
370  XalanNode* theNextSibling = 0,
371  bool fAddXMLNamespaceAttribute = false);
372 
374  createElementNode(
375  const XalanDOMChar* tagName,
376  const AttributeListType& attrs,
377  const PrefixResolver& thePrefixResolver,
378  XalanNode* theParentNode = 0,
379  XalanNode* thePreviousSibling = 0,
380  XalanNode* theNextSibling = 0,
381  bool fAddXMLNamespaceAttribute = false);
382 
384  createElementNode(
385  const XalanDOMChar* name,
386  const AttributesType& attrs,
387  XalanNode* theParentNode = 0,
388  XalanNode* thePreviousSibling = 0,
389  XalanNode* theNextSibling = 0,
390  bool fAddXMLNamespaceAttribute = false);
391 
393  createCommentNode(
394  const XalanDOMChar* data,
396  XalanNode* theParentNode = 0,
397  XalanNode* thePreviousSibling = 0,
398  XalanNode* theNextSibling = 0);
399 
401  createProcessingInstructionNode(
402  const XalanDOMChar* target,
403  const XalanDOMChar* data,
404  XalanNode* theParentNode = 0,
405  XalanNode* thePreviousSibling = 0,
406  XalanNode* theNextSibling = 0);
407 
409  createTextNode(
410  const XalanDOMChar* chars,
412  XalanNode* theParentNode = 0,
413  XalanNode* thePreviousSibling = 0,
414  XalanNode* theNextSibling = 0);
415 
417  createTextIWSNode(
418  const XalanDOMChar* chars,
420  XalanNode* theParentNode = 0,
421  XalanNode* thePreviousSibling = 0,
422  XalanNode* theNextSibling = 0);
423 
424  void
425  unparsedEntityDeclaration(
426  const XalanDOMChar* name,
427  const XalanDOMChar* publicId,
428  const XalanDOMChar* systemId,
429  const XalanDOMChar* notationName);
430 
431  const XalanDOMString&
432  getUnparsedEntityURI(const XalanDOMString& theName) const;
433 
434  // Child node setters...
435  void
436  appendChildNode(XalanSourceTreeComment* theChild);
437 
438  void
439  appendChildNode(XalanSourceTreeElement* theChild);
440 
441  void
442  appendChildNode(XalanSourceTreeProcessingInstruction* theChild);
443 
444 private:
445 
447  getMemoryManager()
448  {
449  return m_stringBuffer.getMemoryManager();
450  }
451 
452  // Helper functions...
453  XalanSourceTreeAttr*
454  createAttribute(
455  const XalanDOMChar* theName,
456  const XalanDOMChar* theValue,
457  XalanSourceTreeElement* theOwnerElement,
458  const PrefixResolver& thePrefixResolver);
459 
460  XalanSourceTreeAttr*
461  createAttribute(
462  const XalanDOMChar* theName,
463  const XalanDOMChar* theValue,
464  XalanSourceTreeElement* theOwnerElement);
465 
466  size_t
467  createAttributes(
468  XalanSourceTreeAttr** theAttributeVector,
469  const AttributeListType& attrs,
470  size_t theStartIndex,
471  XalanSourceTreeElement* theOwnerElement,
472  bool fCreateNamespaces,
473  const PrefixResolver* thePrefixResolver = 0);
474 
476  createElementNode(
477  const XalanDOMChar* theTagName,
478  XalanSourceTreeAttr** theAttributeVector,
479  AttributesCountType theAttributeCount,
480  XalanNode* theParentNode,
481  XalanNode* thePreviousSibling,
482  XalanNode* theNextSibling,
483  const PrefixResolver& thePrefixResolver);
484 
485  size_t
486  createAttributes(
487  XalanSourceTreeAttr** theAttributeVector,
488  const AttributesType& theAttributes,
489  size_t theStartIndex,
490  XalanSourceTreeElement* theOwnerElement,
491  bool fCreateNamespaces);
492 
493  void
494  createAttributes(
495  const AttributesType& theAttributes,
496  XalanSourceTreeAttr** theAttributeVector,
497  XalanSourceTreeElement* theOwnerElement,
498  bool fAddXMLNamespaceAttribute);
499 
500  const XalanDOMString&
501  getTextNodeString(
502  const XalanDOMChar* chars,
504 
505  const XalanDOMString*
506  getNamespaceForPrefix(
507  const XalanDOMChar* theName,
508  const PrefixResolver& thePrefixResolver,
509  XalanDOMString& thePrefix,
510  bool fUseDefault,
511  const XalanDOMChar** theLocalName = 0);
512 
513  // Not implemented...
515 
517  operator=(const XalanSourceTreeDocument& theRHS);
518 
519  bool
520  operator==(const XalanSourceTreeDocument& theRHS) const;
521 
522 
523  // Data members...
524  XalanNode* m_firstChild;
525 
526  XalanSourceTreeElement* m_documentElement;
527 
528  XalanSourceTreeAttributeAllocator m_attributeAllocator;
529 
530  XalanSourceTreeAttributeNSAllocator m_attributeNSAllocator;
531 
532  XalanSourceTreeCommentAllocator m_commentAllocator;
533 
534  XalanSourceTreeElementAAllocator m_elementAAllocator;
535 
536  XalanSourceTreeElementANSAllocator m_elementANSAllocator;
537 
538  XalanSourceTreeElementNAAllocator m_elementNAAllocator;
539 
540  XalanSourceTreeElementNANSAllocator m_elementNANSAllocator;
541 
543 
544  XalanSourceTreeTextAllocator m_textAllocator;
545 
546  XalanSourceTreeTextIWSAllocator m_textIWSAllocator;
547 
548  XalanDOMStringPool m_namesStringPool;
549 
550  XalanDOMStringPool m_valuesStringPool;
551 
552  AttributesArrayAllocatorType m_attributesVector;
553 
554  IndexType m_nextIndexValue;
555 
556  const bool m_poolAllText;
557 
558  ElementByIDMapType m_elementsByID;
559 
560  UnparsedEntityURIMapType m_unparsedEntityURIs;
561 
562  XalanDOMStringAllocator m_nonPooledStrings;
563 
564  XalanDOMString m_stringBuffer;
565 
566  static const XalanDOMString& s_nameString;
567 
568  static bool s_poolAllTextNodes;
569 };
570 
571 
572 
573 XALAN_CPP_NAMESPACE_END
574 
575 
576 
577 #endif // !defined(XALANSOURCETREEDOCUMENT_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