# DOMDocument.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Licensed to the Apache Software Foundation (ASF) under one or more
    00003  * contributor license agreements.  See the NOTICE file distributed with
    00004  * this work for additional information regarding copyright ownership.
    00005  * The ASF licenses this file to You under the Apache License, Version 2.0
    00006  * (the "License"); you may not use this file except in compliance with
    00007  * the License.  You may obtain a copy of the License at
    00008  *
    00009  *      http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  * Unless required by applicable law or agreed to in writing, software
    00012  * distributed under the License is distributed on an "AS IS" BASIS,
    00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  * See the License for the specific language governing permissions and
    00015  * limitations under the License.
    00016  */
    00017
    00018 /*
    00019  * $Id: DOMDocument.hpp 672232 2008-06-27 10:16:38Z borisk $
    00020 */
    00021
    00022 #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENT_HPP)
    00023 #define XERCESC_INCLUDE_GUARD_DOMDOCUMENT_HPP
    00024
    00025 #include <xercesc/util/XercesDefs.hpp>
    00026 #include <xercesc/dom/DOMNode.hpp>
    00027 #include <xercesc/dom/DOMDocumentRange.hpp>
    00028 #include <xercesc/dom/DOMDocumentTraversal.hpp>
    00029 #include <xercesc/dom/DOMXPathEvaluator.hpp>
    00030
    00031 XERCES_CPP_NAMESPACE_BEGIN
    00032
    00033 class DOMConfiguration;
    00034 class DOMDocumentType;
    00035 class DOMElement;
    00036 class DOMDocumentFragment;
    00037 class DOMComment;
    00038 class DOMCDATASection;
    00039 class DOMProcessingInstruction;
    00040 class DOMAttr;
    00041 class DOMEntity;
    00042 class DOMEntityReference;
    00043 class DOMImplementation;
    00044 class DOMNodeFilter;
    00045 class DOMNodeList;
    00046 class DOMNotation;
    00047 class DOMText;
    00048 class DOMNode;
    00049
    00050
    00064 class CDOM_EXPORT DOMDocument: public DOMDocumentRange,
    00065  public DOMXPathEvaluator,
    00066  public DOMDocumentTraversal,
    00067  public DOMNode {
    00068
    00069
    00070 protected:
    00071     // -----------------------------------------------------------------------
    00072     //  Hidden constructors
    00073     // -----------------------------------------------------------------------
    00076     DOMDocument() {};
    00078
    00079 private:
    00080     // -----------------------------------------------------------------------
    00081     // Unimplemented constructors and operators
    00082     // -----------------------------------------------------------------------
    00085     DOMDocument(const DOMDocument &);
    00086     DOMDocument & operator = (const DOMDocument &);
    00088
    00089 public:
    00090     // -----------------------------------------------------------------------
    00091     //  All constructors are hidden, just the destructor is available
    00092     // -----------------------------------------------------------------------
    00099     virtual ~DOMDocument() {};
    00101
    00102     // -----------------------------------------------------------------------
    00103     // Virtual DOMDocument interface
    00104     // -----------------------------------------------------------------------
    00127     virtual DOMElement     *createElement(const XMLCh *tagName) = 0;
    00128
    00134     virtual DOMDocumentFragment   *createDocumentFragment() = 0;
    00135
    00142     virtual DOMText         *createTextNode(const XMLCh *data) = 0;
    00143
    00150     virtual DOMComment      *createComment(const XMLCh *data) = 0;
    00151
    00159     virtual DOMCDATASection   *createCDATASection(const XMLCh *data) = 0;
    00160
    00172     virtual DOMProcessingInstruction *createProcessingInstruction(const XMLCh *target,
    00173         const XMLCh *data) = 0;
    00174
    00175
    00192     virtual DOMAttr     *createAttribute(const XMLCh *name) = 0;
    00193
    00194
    00212     virtual DOMEntityReference    *createEntityReference(const XMLCh *name) = 0;
    00213
    00225     virtual DOMDocumentType       *getDoctype() const = 0;
    00226
    00232     virtual DOMImplementation  *getImplementation() const = 0;
    00233
    00239     virtual DOMElement     *getDocumentElement() const = 0;
    00240
    00255     virtual DOMNodeList      *getElementsByTagName(const XMLCh *tagname) const = 0;
    00256
    00258
    00261
    00360     virtual DOMNode        *importNode(const DOMNode *importedNode, bool deep) = 0;
    00361
    00417     virtual DOMElement         *createElementNS(const XMLCh *namespaceURI,
    00418                                                   const XMLCh *qualifiedName) = 0;
    00419
    00482     virtual DOMAttr        *createAttributeNS(const XMLCh *namespaceURI,
    00483                                                 const XMLCh *qualifiedName) = 0;
    00484
    00497     virtual DOMNodeList        *getElementsByTagNameNS(const XMLCh *namespaceURI,
    00498                                                          const XMLCh *localName) const = 0;
    00499
    00513     virtual  DOMElement        * getElementById(const XMLCh *elementId) const = 0;
    00515
    00518
    00525     virtual const XMLCh*           getInputEncoding() const = 0;
    00526
    00534     virtual const XMLCh*           getXmlEncoding() const = 0;
    00535
    00542     virtual bool                   getXmlStandalone() const = 0;
    00543
    00551     virtual void                   setXmlStandalone(bool standalone) = 0;
    00552
    00560     virtual const XMLCh*           getXmlVersion() const = 0;
    00561
    00569     virtual void                   setXmlVersion(const XMLCh* version) = 0;
    00570
    00579     virtual const XMLCh*           getDocumentURI() const = 0;
    00588     virtual void                   setDocumentURI(const XMLCh* documentURI) = 0;
    00589
    00600     virtual bool                   getStrictErrorChecking() const = 0;
    00611     virtual void                   setStrictErrorChecking(bool strictErrorChecking) = 0;
    00612
    00657     virtual DOMNode* renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* qualifiedName) = 0;
    00658
    00659
    00719     virtual DOMNode*               adoptNode(DOMNode* source) = 0;
    00720
    00741     virtual void                   normalizeDocument() = 0;
    00742
    00743
    00751     virtual DOMConfiguration*      getDOMConfig() const = 0;
    00752
    00754
    00755     // -----------------------------------------------------------------------
    00756     // Non-standard extension
    00757     // -----------------------------------------------------------------------
    00767     virtual DOMEntity     *createEntity(const XMLCh *name) = 0;
    00768
    00777     virtual DOMDocumentType *createDocumentType(const XMLCh *name) = 0;
    00778
    00779     /***
    00780      * Provide default implementation to maintain source code compatibility
    00781      ***/
    00782     virtual DOMDocumentType* createDocumentType(const XMLCh *qName,
    00783                                                 const XMLCh*,  //publicId,
    00784                                                 const XMLCh*   //systemId
    00785                                                )
    00786     {
    00787         return createDocumentType(qName);
    00788     }
    00789
    00798     virtual DOMNotation *createNotation(const XMLCh *name) = 0;
    00799
    00809     virtual DOMElement *createElementNS(const XMLCh *namespaceURI,
    00810                                         const XMLCh *qualifiedName,
    00811                                         const XMLFileLoc lineNum,
    00812                                         const XMLFileLoc columnNum) = 0;
    00814
    00815 };
    00816
    00817 XERCES_CPP_NAMESPACE_END
    00818
    00819 #endif