- Main Page
- Related Pages
- Classes
- Files

# DOMElement.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: DOMElement.hpp 792236 2009-07-08 17:22:35Z amassari $
    00020  */
    00021
    00022 #if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP)
    00023 #define XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP
    00024
    00025 #include <xercesc/util/XercesDefs.hpp>
    00026 #include <xercesc/dom/DOMNode.hpp>
    00027
    00028 XERCES_CPP_NAMESPACE_BEGIN
    00029
    00030
    00031 class DOMAttr;
    00032 class DOMNodeList;
    00033 class DOMTypeInfo;
    00034
    00035
    00066 class CDOM_EXPORT DOMElement: public DOMNode {
    00067 protected:
    00068     // -----------------------------------------------------------------------
    00069     //  Hidden constructors
    00070     // -----------------------------------------------------------------------
    00073     DOMElement() {}
    00074     DOMElement(const DOMElement &other) : DOMNode(other) {}
    00076
    00077 private:
    00078     // -----------------------------------------------------------------------
    00079     // Unimplemented constructors and operators
    00080     // -----------------------------------------------------------------------
    00083     DOMElement & operator = (const DOMElement &);
    00085
    00086 public:
    00087     // -----------------------------------------------------------------------
    00088     //  All constructors are hidden, just the destructor is available
    00089     // -----------------------------------------------------------------------
    00096     virtual ~DOMElement() {};
    00098
    00099     // -----------------------------------------------------------------------
    00100     //  Virtual DOMElement interface
    00101     // -----------------------------------------------------------------------
    00104     // -----------------------------------------------------------------------
    00105     //  Getter methods
    00106     // -----------------------------------------------------------------------
    00116     virtual const XMLCh *         getTagName() const = 0;
    00117
    00126     virtual const XMLCh *         getAttribute(const XMLCh *name) const = 0;
    00127
    00136     virtual DOMAttr       * getAttributeNode(const XMLCh *name) const = 0;
    00137
    00148     virtual DOMNodeList   * getElementsByTagName(const XMLCh *name) const = 0;
    00149
    00150     // -----------------------------------------------------------------------
    00151     //  Setter methods
    00152     // -----------------------------------------------------------------------
    00175     virtual void             setAttribute(const XMLCh *name,
    00176                                   const XMLCh *value) = 0;
    00197     virtual DOMAttr       * setAttributeNode(DOMAttr *newAttr) = 0;
    00198
    00215     virtual DOMAttr       * removeAttributeNode(DOMAttr *oldAttr) = 0;
    00216
    00230     virtual void              removeAttribute(const XMLCh *name) = 0;
    00232
    00246     virtual const XMLCh *         getAttributeNS(const XMLCh *namespaceURI,
    00247                                                  const XMLCh *localName) const = 0;
    00248
    00288     virtual void             setAttributeNS(const XMLCh *namespaceURI,
    00289                                             const XMLCh *qualifiedName, const XMLCh *value) = 0;
    00290
    00305     virtual void              removeAttributeNS(const XMLCh *namespaceURI,
    00306                                                 const XMLCh *localName) = 0;
    00307
    00319     virtual DOMAttr      *  getAttributeNodeNS(const XMLCh *namespaceURI,
    00320                                                const XMLCh *localName) const = 0;
    00321
    00343     virtual DOMAttr      *  setAttributeNodeNS(DOMAttr *newAttr) = 0;
    00344
    00360     virtual DOMNodeList   * getElementsByTagNameNS(const XMLCh *namespaceURI,
    00361                                                    const XMLCh *localName) const = 0;
    00362
    00373     virtual bool         hasAttribute(const XMLCh *name) const = 0;
    00374
    00387     virtual bool         hasAttributeNS(const XMLCh *namespaceURI,
    00388                                         const XMLCh *localName) const = 0;
    00390
    00393
    00414     virtual void setIdAttribute(const XMLCh* name, bool isId) = 0;
    00415
    00416
    00435     virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId) = 0;
    00436
    00437
    00438
    00456     virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId) = 0;
    00457
    00458
    00459
    00466     virtual const DOMTypeInfo* getSchemaTypeInfo() const = 0;
    00467
    00469
    00470     // -----------------------------------------------------------------------
    00471     //  DOMElementTraversal interface
    00472     // -----------------------------------------------------------------------
    00475     // -----------------------------------------------------------------------
    00476     //  Getter methods
    00477     // -----------------------------------------------------------------------
    00484     virtual DOMElement *         getFirstElementChild() const = 0;
    00485
    00492     virtual DOMElement *         getLastElementChild() const = 0;
    00493
    00500     virtual DOMElement *         getPreviousElementSibling() const = 0;
    00501
    00508     virtual DOMElement *         getNextElementSibling() const = 0;
    00509
    00519     virtual XMLSize_t            getChildElementCount() const = 0;
    00521 };
    00522
    00523 XERCES_CPP_NAMESPACE_END
    00524
    00525 #endif
    00526
    00527
    00528