| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # DOMDocument.hpp Go to the documentation of this file.
    00001 #ifndef DOMDocument_HEADER_GUARD_
    00002 #define DOMDocument_HEADER_GUARD_
    00003
    00004 /*
    00005  * Copyright 2001-2002,2004 The Apache Software Foundation.
    00006  *
    00007  * Licensed under the Apache License, Version 2.0 (the "License");
    00008  * you may not use this file except in compliance with the License.
    00009  * You may obtain a copy of the License at
    00010  *
    00011  *      http://www.apache.org/licenses/LICENSE-2.0
    00012  *
    00013  * Unless required by applicable law or agreed to in writing, software
    00014  * distributed under the License is distributed on an "AS IS" BASIS,
    00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00016  * See the License for the specific language governing permissions and
    00017  * limitations under the License.
    00018  */
    00019
    00020 /*
    00021  * $Id: DOMDocument.hpp 176250 2004-12-21 16:02:51Z cargilld $
    00022 */
    00023
    00024 #include <xercesc/util/XercesDefs.hpp>
    00025 #include <xercesc/dom/DOMNode.hpp>
    00026 #include <xercesc/dom/DOMDocumentRange.hpp>
    00027 #include <xercesc/dom/DOMDocumentTraversal.hpp>
    00028 #include <xercesc/dom/DOMXPathEvaluator.hpp>
    00029
    00030 XERCES_CPP_NAMESPACE_BEGIN
    00031
    00032 class DOMConfiguration;
    00033 class DOMDocumentType;
    00034 class DOMElement;
    00035 class DOMDocumentFragment;
    00036 class DOMComment;
    00037 class DOMCDATASection;
    00038 class DOMProcessingInstruction;
    00039 class DOMAttr;
    00040 class DOMEntity;
    00041 class DOMEntityReference;
    00042 class DOMImplementation;
    00043 class DOMNodeFilter;
    00044 class DOMNodeList;
    00045 class DOMNotation;
    00046 class DOMText;
    00047 class DOMNode;
    00048
    00049
    00063 class  DOMDocument: public DOMDocumentRange,
    00064  public DOMXPathEvaluator,
    00065  public DOMDocumentTraversal,
    00066  public DOMNode {
    00067
    00068
    00069 protected:
    00070     // -----------------------------------------------------------------------
    00071     //  Hidden constructors
    00072     // -----------------------------------------------------------------------
    00075     DOMDocument() {};
    00077
    00078 private:
    00079     // -----------------------------------------------------------------------
    00080     // Unimplemented constructors and operators
    00081     // -----------------------------------------------------------------------
    00084     DOMDocument(const DOMDocument &);
    00085     DOMDocument & operator = (const DOMDocument &);
    00087
    00088 public:
    00089     // -----------------------------------------------------------------------
    00090     //  All constructors are hidden, just the destructor is available
    00091     // -----------------------------------------------------------------------
    00098     virtual ~DOMDocument() {};
    00100
    00101     // -----------------------------------------------------------------------
    00102     // Virtual DOMDocument interface
    00103     // -----------------------------------------------------------------------
    00126     virtual DOMElement     *createElement(const XMLCh *tagName) = 0;
    00127
    00133     virtual DOMDocumentFragment   *createDocumentFragment() = 0;
    00134
    00141     virtual DOMText         *createTextNode(const XMLCh *data) = 0;
    00142
    00149     virtual DOMComment      *createComment(const XMLCh *data) = 0;
    00150
    00158     virtual DOMCDATASection   *createCDATASection(const XMLCh *data) = 0;
    00159
    00171     virtual DOMProcessingInstruction *createProcessingInstruction(const XMLCh *target,
    00172         const XMLCh *data) = 0;
    00173
    00174
    00191     virtual DOMAttr     *createAttribute(const XMLCh *name) = 0;
    00192
    00193
    00211     virtual DOMEntityReference    *createEntityReference(const XMLCh *name) = 0;
    00212
    00224     virtual DOMDocumentType       *getDoctype() const = 0;
    00225
    00231     virtual DOMImplementation  *getImplementation() const = 0;
    00232
    00238     virtual DOMElement     *getDocumentElement() const = 0;
    00239
    00254     virtual DOMNodeList      *getElementsByTagName(const XMLCh *tagname) const = 0;
    00255
    00257
    00260
    00359     virtual DOMNode        *importNode(DOMNode *importedNode, bool deep) = 0;
    00360
    00416     virtual DOMElement         *createElementNS(const XMLCh *namespaceURI,
    00417                                                   const XMLCh *qualifiedName) = 0;
    00418
    00481     virtual DOMAttr        *createAttributeNS(const XMLCh *namespaceURI,
    00482                                                 const XMLCh *qualifiedName) = 0;
    00483
    00496     virtual DOMNodeList        *getElementsByTagNameNS(const XMLCh *namespaceURI,
    00497                                                          const XMLCh *localName) const = 0;
    00498
    00512     virtual  DOMElement        * getElementById(const XMLCh *elementId) const = 0;
    00514
    00517
    00528     virtual const XMLCh*           getActualEncoding() const = 0;
    00529
    00540     virtual void                   setActualEncoding(const XMLCh* actualEncoding) = 0;
    00541
    00550     virtual const XMLCh*           getEncoding() const = 0;
    00551
    00560     virtual void                   setEncoding(const XMLCh* encoding) = 0;
    00561
    00571     virtual bool                   getStandalone() const = 0;
    00572
    00582     virtual void                   setStandalone(bool standalone) = 0;
    00583
    00593     virtual const XMLCh*           getVersion() const = 0;
    00594
    00604     virtual void                   setVersion(const XMLCh* version) = 0;
    00605
    00616     virtual const XMLCh*           getDocumentURI() const = 0;
    00627     virtual void                   setDocumentURI(const XMLCh* documentURI) = 0;
    00628
    00641     virtual bool                   getStrictErrorChecking() const = 0;
    00654     virtual void                   setStrictErrorChecking(bool strictErrorChecking) = 0;
    00655
    00702     virtual DOMNode* renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* name) = 0;
    00703
    00704
    00766     virtual DOMNode*               adoptNode(DOMNode* source) = 0;
    00767
    00792     virtual void                   normalizeDocument() = 0;
    00793
    00794
    00810     virtual DOMConfiguration*      getDOMConfiguration() const = 0;
    00811
    00813
    00814     // -----------------------------------------------------------------------
    00815     // Non-standard extension
    00816     // -----------------------------------------------------------------------
    00826     virtual DOMEntity     *createEntity(const XMLCh *name) = 0;
    00827
    00836     virtual DOMDocumentType *createDocumentType(const XMLCh *name) = 0;
    00837
    00838     /***
    00839      * Provide default implementation to maintain source code compatibility
    00840      ***/
    00841     virtual DOMDocumentType* createDocumentType(const XMLCh *qName,
    00842                                                 const XMLCh*,  //publicId,
    00843                                                 const XMLCh*   //systemId
    00844                                                )
    00845     {
    00846         return createDocumentType(qName);
    00847     }
    00848
    00857     virtual DOMNotation *createNotation(const XMLCh *name) = 0;
    00858
    00868     virtual DOMElement         *createElementNS(const XMLCh *namespaceURI,
    00869                                                   const XMLCh *qualifiedName,
    00870                                                   const XMLSSize_t lineNum,
    00871                                                   const XMLSSize_t columnNum) = 0;
    00873
    00874 };
    00875
    00876 XERCES_CPP_NAMESPACE_END
    00877
    00878 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.