## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.10

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

# XalanSourceTreeDocument.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright 1999-2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *     http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016 #if !defined(XALANSOURCETREEDOCUMENT_HEADER_GUARD_1357924680)
    00017 #define XALANSOURCETREEDOCUMENT_HEADER_GUARD_1357924680
    00018
    00019
    00020
    00021 #include <xalanc/XalanSourceTree/XalanSourceTreeDefinitions.hpp>
    00022
    00023
    00024
    00025 #include <xalanc/XalanDOM/XalanDocument.hpp>
    00026 #include <xalanc/XalanDOM/XalanDOMString.hpp>
    00027
    00028
    00029
    00030 #include <xalanc/Include/STLHelper.hpp>
    00031 #include <xalanc/Include/XalanMap.hpp>
    00032
    00033
    00034
    00035 #include <xalanc/PlatformSupport/XalanArrayAllocator.hpp>
    00036 #include <xalanc/PlatformSupport/XalanDOMStringAllocator.hpp>
    00037 #include <xalanc/PlatformSupport/XalanDOMStringPool.hpp>
    00038
    00039
    00040
    00041 #include <xalanc/XalanSourceTree/XalanSourceTreeAttributeAllocator.hpp>
    00042 #include <xalanc/XalanSourceTree/XalanSourceTreeAttributeNSAllocator.hpp>
    00043 #include <xalanc/XalanSourceTree/XalanSourceTreeCommentAllocator.hpp>
    00044 #include <xalanc/XalanSourceTree/XalanSourceTreeElementAAllocator.hpp>
    00045 #include <xalanc/XalanSourceTree/XalanSourceTreeElementANSAllocator.hpp>
    00046 #include <xalanc/XalanSourceTree/XalanSourceTreeElementNAAllocator.hpp>
    00047 #include <xalanc/XalanSourceTree/XalanSourceTreeElementNANSAllocator.hpp>
    00048 #include <xalanc/XalanSourceTree/XalanSourceTreeProcessingInstructionAllocator.hpp>
    00049 #include <xalanc/XalanSourceTree/XalanSourceTreeTextAllocator.hpp>
    00050 #include <xalanc/XalanSourceTree/XalanSourceTreeTextIWSAllocator.hpp>
    00051
    00052
    00053
    00054 XALAN_DECLARE_XERCES_CLASS(Attributes)
    00055 XALAN_DECLARE_XERCES_CLASS(AttributeList)
    00056
    00057
    00058
    00059 XALAN_CPP_NAMESPACE_BEGIN
    00060
    00061
    00062
    00063 typedef XERCES_CPP_NAMESPACE_QUALIFIER Attributes       AttributesType;
    00064 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList    AttributeListType;
    00065
    00066
    00067
    00068 class PrefixResolver;
    00069 class XalanSourceTreeAttr;
    00070
    00071
    00072
    00073 class XALAN_XALANSOURCETREE_EXPORT XalanSourceTreeDocument : public XalanDocument
    00074 {
    00075 public:
    00076
    00077     typedef XalanSourceTreeElementA::AttributesCountType    AttributesCountType;
    00078     typedef XalanArrayAllocator<XalanSourceTreeAttr*>       AttributesArrayAllocatorType;
    00079
    00080     typedef XalanMap<
    00081                 const XalanDOMChar*,
    00082                 XalanSourceTreeElement*>                    ElementByIDMapType;
    00083
    00084     typedef XalanMap<
    00085                 XalanDOMString,
    00086                 XalanDOMString>                             UnparsedEntityURIMapType;
    00087
    00088
    00092     static void
    00093     initialize(MemoryManagerType& theManager);
    00094
    00098     static void
    00099     terminate();
    00100
    00101
    00102     enum { eDefaultAttributeAllocatorBlockSize = 100,
    00103            eDefaultAttributeNSAllocatorBlockSize = 50,
    00104            eDefaultCommentAllocatorBlockSize = 10,
    00105            eDefaultElementAllocatorBlockSize = 100,
    00106            eDefaultElementNSAllocatorBlockSize = 100,
    00107            eDefaultPIAllocatorBlockSize = 10,
    00108            eDefaultTextAllocatorBlockSize = 100,
    00109            eDefaultTextIWSAllocatorBlockSize = 100,
    00110            eDefaultNamesStringPoolBlockSize = XalanDOMStringPool::eDefaultBlockSize,
    00111            eDefaultNamesStringPoolBucketCount = XalanDOMStringPool::eDefaultBucketCount,
    00112            eDefaultNamesStringPoolBucketSize = XalanDOMStringPool::eDefaultBucketSize,
    00113            eDefaultValuesStringPoolBlockSize = XalanDOMStringPool::eDefaultBlockSize,
    00114            eDefaultValuesStringPoolBucketCount = 997,
    00115            eDefaultValuesStringPoolBucketSize = XalanDOMStringPool::eDefaultBucketSize };
    00116
    00117
    00118     typedef XalanSourceTreeAttributeAllocator::size_type    allocator_size_type;
    00119     typedef XalanDOMStringPool::block_size_type             block_size_type;
    00120     typedef XalanDOMStringPool::bucket_count_type           bucket_count_type;
    00121     typedef XalanDOMStringPool::bucket_size_type            bucket_size_type;
    00122
    00136     XalanSourceTreeDocument(
    00137             MemoryManagerType&  theManager,
    00138             bool                fPoolAllText = s_poolAllTextNodes,
    00139             block_size_type     theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
    00140             bucket_count_type   theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
    00141             bucket_size_type    theNamesStringPoolBucketSize = eDefaultNamesStringPoolBucketSize,
    00142             block_size_type     theValuesStringPoolBlockSize = eDefaultValuesStringPoolBlockSize,
    00143             bucket_count_type   theValuesStringPoolBucketCount = eDefaultValuesStringPoolBucketCount,
    00144             bucket_size_type    theValuesStringPoolBucketSize = eDefaultValuesStringPoolBucketSize);
    00145
    00146
    00147     static XalanSourceTreeDocument*
    00148     create(
    00149             MemoryManagerType&  theManager,
    00150             bool                fPoolAllText = s_poolAllTextNodes,
    00151             block_size_type     theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
    00152             bucket_count_type   theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
    00153             bucket_size_type    theNamesStringPoolBucketSize = eDefaultNamesStringPoolBucketSize,
    00154             block_size_type     theValuesStringPoolBlockSize = eDefaultValuesStringPoolBlockSize,
    00155             bucket_count_type   theValuesStringPoolBucketCount = eDefaultValuesStringPoolBucketCount,
    00156             bucket_size_type    theValuesStringPoolBucketSize = eDefaultValuesStringPoolBucketSize);
    00157
    00172     XalanSourceTreeDocument(
    00173             MemoryManagerType&      theManager,
    00174             allocator_size_type     theAttributeBlockSize,
    00175             allocator_size_type     theAttributeNSBlockSize,
    00176             allocator_size_type     theCommentBlockSize,
    00177             allocator_size_type     theElementBlockSize,
    00178             allocator_size_type     theElementNSBlockSize,
    00179             allocator_size_type     thePIBlockSize,
    00180             allocator_size_type     theTextBlockSize,
    00181             allocator_size_type     theTextIWSBlockSize,
    00182             bool                    fPoolAllText = s_poolAllTextNodes);
    00183
    00184     virtual
    00185     ~XalanSourceTreeDocument();
    00186
    00187     // These interfaces are inherited from XalanNode...
    00188     virtual const XalanDOMString&
    00189     getNodeName() const;
    00190
    00191     virtual const XalanDOMString&
    00192     getNodeValue() const;
    00193
    00194     virtual NodeType
    00195     getNodeType() const;
    00196
    00197     virtual XalanNode*
    00198     getParentNode() const;
    00199
    00200     virtual const XalanNodeList*
    00201     getChildNodes() const;
    00202
    00203     virtual XalanNode*
    00204     getFirstChild() const;
    00205
    00206     virtual XalanNode*
    00207     getLastChild() const;
    00208
    00209     virtual XalanNode*
    00210     getPreviousSibling() const;
    00211
    00212     virtual XalanNode*
    00213     getNextSibling() const;
    00214
    00215     virtual const XalanNamedNodeMap*
    00216     getAttributes() const;
    00217
    00218     virtual XalanDocument*
    00219     getOwnerDocument() const;
    00220
    00221 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
    00222     virtual XalanNode*
    00223 #else
    00224     virtual XalanSourceTreeDocument*
    00225 #endif
    00226     cloneNode(bool deep) const;
    00227
    00228     virtual XalanNode*
    00229     insertBefore(
    00230             XalanNode*  newChild,
    00231             XalanNode*  refChild);
    00232
    00233     virtual XalanNode*
    00234     replaceChild(
    00235             XalanNode*  newChild,
    00236             XalanNode*  oldChild);
    00237
    00238     virtual XalanNode*
    00239     removeChild(XalanNode*  oldChild);
    00240
    00241     virtual XalanNode*
    00242     appendChild(XalanNode*  newChild);
    00243
    00244     virtual bool
    00245     hasChildNodes() const;
    00246
    00247     virtual void
    00248     setNodeValue(const XalanDOMString&      nodeValue);
    00249
    00250     virtual void
    00251     normalize();
    00252
    00253     virtual bool
    00254     isSupported(
    00255             const XalanDOMString&   feature,
    00256             const XalanDOMString&   version) const;
    00257
    00258     virtual const XalanDOMString&
    00259     getNamespaceURI() const;
    00260
    00261     virtual const XalanDOMString&
    00262     getPrefix() const;
    00263
    00264     virtual const XalanDOMString&
    00265     getLocalName() const;
    00266
    00267     virtual void
    00268     setPrefix(const XalanDOMString& prefix);
    00269
    00270     virtual bool
    00271     isIndexed() const;
    00272
    00273     virtual IndexType
    00274     getIndex() const;
    00275
    00276     virtual XalanElement*
    00277     createElement(const XalanDOMString& tagName);
    00278
    00279     virtual XalanDocumentFragment*
    00280     createDocumentFragment();
    00281
    00282     virtual XalanText*
    00283     createTextNode(const XalanDOMString&    data);
    00284
    00285     virtual XalanComment*
    00286     createComment(const XalanDOMString& data);
    00287
    00288     virtual XalanCDATASection*
    00289     createCDATASection(const XalanDOMString&    data);
    00290
    00291     virtual XalanProcessingInstruction*
    00292     createProcessingInstruction(
    00293             const XalanDOMString&   target,
    00294             const XalanDOMString&   data);
    00295
    00296     virtual XalanAttr*
    00297     createAttribute(const XalanDOMString&   name);
    00298
    00299     virtual XalanEntityReference*
    00300     createEntityReference(const XalanDOMString& name);
    00301
    00302     virtual XalanDocumentType*
    00303     getDoctype() const;
    00304
    00305     virtual XalanDOMImplementation*
    00306     getImplementation() const;
    00307
    00308     virtual XalanElement*
    00309     getDocumentElement() const;
    00310
    00311     virtual XalanNodeList*
    00312     getElementsByTagName(const XalanDOMString&      tagname) const;
    00313
    00314     virtual XalanNode*
    00315     importNode(
    00316             XalanNode*  importedNode,
    00317             bool        deep);
    00318
    00319     virtual XalanElement*
    00320     createElementNS(
    00321             const XalanDOMString&   namespaceURI,
    00322             const XalanDOMString&   qualifiedName);
    00323
    00324     virtual XalanAttr*
    00325     createAttributeNS(
    00326             const XalanDOMString& namespaceURI,
    00327             const XalanDOMString& qualifiedName);
    00328
    00329     virtual XalanNodeList*
    00330     getElementsByTagNameNS(
    00331             const XalanDOMString&   namespaceURI,
    00332             const XalanDOMString&   localName) const;
    00333
    00334     virtual XalanElement*
    00335     getElementById(const XalanDOMString&    elementId) const;
    00336
    00337
    00338     // Interfaces not inherited from XalanDocument...
    00339
    00340     static bool
    00341     getPoolAllTextNodes()
    00342     {
    00343         return s_poolAllTextNodes;
    00344     }
    00345
    00346     static void
    00347     setPoolAllTextNodes(bool    fPool)
    00348     {
    00349         s_poolAllTextNodes = fPool;
    00350     }
    00351
    00352
    00353     XalanSourceTreeElement*
    00354     createElementNode(
    00355             const XalanDOMChar*         name,
    00356             const AttributeListType&    attrs,
    00357             XalanNode*                  theParentNode = 0,
    00358             XalanNode*                  thePreviousSibling = 0,
    00359             XalanNode*                  theNextSibling = 0,
    00360             bool                        fAddXMLNamespaceAttribute = false);
    00361
    00362     XalanSourceTreeElement*
    00363     createElementNode(
    00364             const XalanDOMChar*         uri,
    00365             const XalanDOMChar*         localname,
    00366             const XalanDOMChar*         qname,
    00367             const AttributesType&       attrs,
    00368             XalanNode*                  theParentNode = 0,
    00369             XalanNode*                  thePreviousSibling = 0,
    00370             XalanNode*                  theNextSibling = 0,
    00371             bool                        fAddXMLNamespaceAttribute = false);
    00372
    00373     XalanSourceTreeElement*
    00374     createElementNode(
    00375             const XalanDOMChar*         tagName,
    00376             const AttributeListType&    attrs,
    00377             const PrefixResolver&       thePrefixResolver,
    00378             XalanNode*                  theParentNode = 0,
    00379             XalanNode*                  thePreviousSibling = 0,
    00380             XalanNode*                  theNextSibling = 0,
    00381             bool                        fAddXMLNamespaceAttribute = false);
    00382
    00383     XalanSourceTreeElement*
    00384     createElementNode(
    00385             const XalanDOMChar*         name,
    00386             const AttributesType&       attrs,
    00387             XalanNode*                  theParentNode = 0,
    00388             XalanNode*                  thePreviousSibling = 0,
    00389             XalanNode*                  theNextSibling = 0,
    00390             bool                        fAddXMLNamespaceAttribute = false);
    00391
    00392     XalanSourceTreeComment*
    00393     createCommentNode(
    00394             const XalanDOMChar*         data,
    00395             XalanDOMString::size_type   length,
    00396             XalanNode*                  theParentNode = 0,
    00397             XalanNode*                  thePreviousSibling = 0,
    00398             XalanNode*                  theNextSibling = 0);
    00399
    00400     XalanSourceTreeProcessingInstruction*
    00401     createProcessingInstructionNode(
    00402             const XalanDOMChar*     target,
    00403             const XalanDOMChar*     data,
    00404             XalanNode*              theParentNode = 0,
    00405             XalanNode*              thePreviousSibling = 0,
    00406             XalanNode*              theNextSibling = 0);
    00407
    00408     XalanSourceTreeText*
    00409     createTextNode(
    00410             const XalanDOMChar*         chars,
    00411             XalanDOMString::size_type   length,
    00412             XalanNode*                  theParentNode = 0,
    00413             XalanNode*                  thePreviousSibling = 0,
    00414             XalanNode*                  theNextSibling = 0);
    00415
    00416     XalanSourceTreeText*
    00417     createTextIWSNode(
    00418             const XalanDOMChar*         chars,
    00419             XalanDOMString::size_type   length,
    00420             XalanNode*                  theParentNode = 0,
    00421             XalanNode*                  thePreviousSibling = 0,
    00422             XalanNode*                  theNextSibling = 0);
    00423
    00424     void
    00425     unparsedEntityDeclaration(
    00426             const XalanDOMChar*     name,
    00427             const XalanDOMChar*     publicId,
    00428             const XalanDOMChar*     systemId,
    00429             const XalanDOMChar*     notationName);
    00430
    00431     const XalanDOMString&
    00432     getUnparsedEntityURI(const XalanDOMString&  theName) const;
    00433
    00434     // Child node setters...
    00435     void
    00436     appendChildNode(XalanSourceTreeComment*     theChild);
    00437
    00438     void
    00439     appendChildNode(XalanSourceTreeElement*     theChild);
    00440
    00441     void
    00442     appendChildNode(XalanSourceTreeProcessingInstruction*   theChild);
    00443
    00444 private:
    00445
    00446     MemoryManagerType&
    00447     getMemoryManager()
    00448     {
    00449         return m_stringBuffer.getMemoryManager();
    00450     }
    00451
    00452     // Helper functions...
    00453     XalanSourceTreeAttr*
    00454     createAttribute(
    00455             const XalanDOMChar*         theName,
    00456             const XalanDOMChar*         theValue,
    00457             XalanSourceTreeElement*     theOwnerElement,
    00458             const PrefixResolver&       thePrefixResolver);
    00459
    00460     XalanSourceTreeAttr*
    00461     createAttribute(
    00462             const XalanDOMChar*         theName,
    00463             const XalanDOMChar*         theValue,
    00464             XalanSourceTreeElement*     theOwnerElement);
    00465
    00466     size_t
    00467     createAttributes(
    00468             XalanSourceTreeAttr**       theAttributeVector,
    00469             const AttributeListType&    attrs,
    00470             size_t                      theStartIndex,
    00471             XalanSourceTreeElement*     theOwnerElement,
    00472             bool                        fCreateNamespaces,
    00473             const PrefixResolver*       thePrefixResolver = 0);
    00474
    00475     XalanSourceTreeElement*
    00476     createElementNode(
    00477             const XalanDOMChar*     theTagName,
    00478             XalanSourceTreeAttr**   theAttributeVector,
    00479             AttributesCountType     theAttributeCount,
    00480             XalanNode*              theParentNode,
    00481             XalanNode*              thePreviousSibling,
    00482             XalanNode*              theNextSibling,
    00483             const PrefixResolver&   thePrefixResolver);
    00484
    00485     size_t
    00486     createAttributes(
    00487             XalanSourceTreeAttr**       theAttributeVector,
    00488             const AttributesType&       theAttributes,
    00489             size_t                      theStartIndex,
    00490             XalanSourceTreeElement*     theOwnerElement,
    00491             bool                        fCreateNamespaces);
    00492
    00493     void
    00494     createAttributes(
    00495             const AttributesType&       theAttributes,
    00496             XalanSourceTreeAttr**       theAttributeVector,
    00497             XalanSourceTreeElement*     theOwnerElement,
    00498             bool                        fAddXMLNamespaceAttribute);
    00499
    00500     const XalanDOMString&
    00501     getTextNodeString(
    00502             const XalanDOMChar*         chars,
    00503             XalanDOMString::size_type   length);
    00504
    00505     const XalanDOMString*
    00506     getNamespaceForPrefix(
    00507             const XalanDOMChar*     theName,
    00508             const PrefixResolver&   thePrefixResolver,
    00509             XalanDOMString&         thePrefix,
    00510             bool                    fUseDefault,
    00511             const XalanDOMChar**    theLocalName = 0);
    00512
    00513     // Not implemented...
    00514     XalanSourceTreeDocument(const XalanSourceTreeDocument&  theSource);
    00515
    00516     XalanSourceTreeDocument&
    00517     operator=(const XalanSourceTreeDocument&    theRHS);
    00518
    00519     bool
    00520     operator==(const XalanSourceTreeDocument&   theRHS) const;
    00521
    00522
    00523     // Data members...
    00524     XalanNode*                                      m_firstChild;
    00525
    00526     XalanSourceTreeElement*                         m_documentElement;
    00527
    00528     XalanSourceTreeAttributeAllocator               m_attributeAllocator;
    00529
    00530     XalanSourceTreeAttributeNSAllocator             m_attributeNSAllocator;
    00531
    00532     XalanSourceTreeCommentAllocator                 m_commentAllocator;
    00533
    00534     XalanSourceTreeElementAAllocator                m_elementAAllocator;
    00535
    00536     XalanSourceTreeElementANSAllocator              m_elementANSAllocator;
    00537
    00538     XalanSourceTreeElementNAAllocator               m_elementNAAllocator;
    00539
    00540     XalanSourceTreeElementNANSAllocator             m_elementNANSAllocator;
    00541
    00542     XalanSourceTreeProcessingInstructionAllocator   m_piAllocator;
    00543
    00544     XalanSourceTreeTextAllocator                    m_textAllocator;
    00545
    00546     XalanSourceTreeTextIWSAllocator                 m_textIWSAllocator;
    00547
    00548     XalanDOMStringPool                              m_namesStringPool;
    00549
    00550     XalanDOMStringPool                              m_valuesStringPool;
    00551
    00552     AttributesArrayAllocatorType                    m_attributesVector;
    00553
    00554     IndexType                                       m_nextIndexValue;
    00555
    00556     const bool                                      m_poolAllText;
    00557
    00558     ElementByIDMapType                              m_elementsByID;
    00559
    00560     UnparsedEntityURIMapType                        m_unparsedEntityURIs;
    00561
    00562     XalanDOMStringAllocator                         m_nonPooledStrings;
    00563
    00564     XalanDOMString                                  m_stringBuffer;
    00565
    00566     static const XalanDOMString&                    s_nameString;
    00567
    00568     static bool                                     s_poolAllTextNodes;
    00569 };
    00570
    00571
    00572
    00573 XALAN_CPP_NAMESPACE_END
    00574
    00575
    00576
    00577 #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.

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