Xerces-C++ 3.2.5

DOMElement.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP
24
25#include <xercesc/util/XercesDefs.hpp>
26#include <xercesc/dom/DOMNode.hpp>
27
28 XERCES_CPP_NAMESPACE_BEGIN
29
30
31 class DOMAttr;
32 class DOMNodeList;
33 class DOMTypeInfo;
34
35
66 class CDOM_EXPORT DOMElement: public DOMNode {
67 protected:
68 // -----------------------------------------------------------------------
69 // Hidden constructors
70 // -----------------------------------------------------------------------
73 DOMElement() {}
74 DOMElement(const DOMElement &other) : DOMNode(other) {}
76
77 private:
78 // -----------------------------------------------------------------------
79 // Unimplemented constructors and operators
80 // -----------------------------------------------------------------------
83 DOMElement & operator = (const DOMElement &);
85
86 public:
87 // -----------------------------------------------------------------------
88 // All constructors are hidden, just the destructor is available
89 // -----------------------------------------------------------------------
96 virtual ~DOMElement() {};
98
99 // -----------------------------------------------------------------------
100 // Virtual DOMElement interface
101 // -----------------------------------------------------------------------
104 // -----------------------------------------------------------------------
105 // Getter methods
106 // -----------------------------------------------------------------------
116 virtual const XMLCh * getTagName() const = 0;
117
126 virtual const XMLCh * getAttribute(const XMLCh *name) const = 0;
127
136 virtual DOMAttr * getAttributeNode(const XMLCh *name) const = 0;
137
148 virtual DOMNodeList * getElementsByTagName(const XMLCh *name) const = 0;
149
150 // -----------------------------------------------------------------------
151 // Setter methods
152 // -----------------------------------------------------------------------
175 virtual void setAttribute(const XMLCh *name,
176 const XMLCh *value) = 0;
197 virtual DOMAttr * setAttributeNode(DOMAttr *newAttr) = 0;
198
215 virtual DOMAttr * removeAttributeNode(DOMAttr *oldAttr) = 0;
216
230 virtual void removeAttribute(const XMLCh *name) = 0;
232
246 virtual const XMLCh * getAttributeNS(const XMLCh *namespaceURI,
247 const XMLCh *localName) const = 0;
248
288 virtual void setAttributeNS(const XMLCh *namespaceURI,
289 const XMLCh *qualifiedName, const XMLCh *value) = 0;
290
305 virtual void removeAttributeNS(const XMLCh *namespaceURI,
306 const XMLCh *localName) = 0;
307
319 virtual DOMAttr * getAttributeNodeNS(const XMLCh *namespaceURI,
320 const XMLCh *localName) const = 0;
321
343 virtual DOMAttr * setAttributeNodeNS(DOMAttr *newAttr) = 0;
344
360 virtual DOMNodeList * getElementsByTagNameNS(const XMLCh *namespaceURI,
361 const XMLCh *localName) const = 0;
362
373 virtual bool hasAttribute(const XMLCh *name) const = 0;
374
387 virtual bool hasAttributeNS(const XMLCh *namespaceURI,
388 const XMLCh *localName) const = 0;
390
393
414 virtual void setIdAttribute(const XMLCh* name, bool isId) = 0;
415
416
435 virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId) = 0;
436
437
438
456 virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId) = 0;
457
458
459
466 virtual const DOMTypeInfo* getSchemaTypeInfo() const = 0;
467
469
470 // -----------------------------------------------------------------------
471 // DOMElementTraversal interface
472 // -----------------------------------------------------------------------
475 // -----------------------------------------------------------------------
476 // Getter methods
477 // -----------------------------------------------------------------------
484 virtual DOMElement * getFirstElementChild() const = 0;
485
492 virtual DOMElement * getLastElementChild() const = 0;
493
500 virtual DOMElement * getPreviousElementSibling() const = 0;
501
508 virtual DOMElement * getNextElementSibling() const = 0;
509
519 virtual XMLSize_t getChildElementCount() const = 0;
521};
522
523 XERCES_CPP_NAMESPACE_END
524
525#endif
526
527
528
DOMNode.hpp
XercesDefs.hpp
CDOM_EXPORT
#define CDOM_EXPORT
Definition XercesDefs.hpp:166
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
XMLSize_t
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
DOMAttr
The DOMAttr class refers to an attribute of an XML element.
Definition DOMAttr.hpp:57
DOMElement
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition DOMElement.hpp:66
DOMElement::setAttributeNodeNS
virtual DOMAttr * setAttributeNodeNS(DOMAttr *newAttr)=0
Adds a new attribute.
DOMElement::setAttribute
virtual void setAttribute(const XMLCh *name, const XMLCh *value)=0
Adds a new attribute.
DOMElement::~DOMElement
virtual ~DOMElement()
Destructor.
Definition DOMElement.hpp:96
DOMElement::setIdAttribute
virtual void setIdAttribute(const XMLCh *name, bool isId)=0
If the parameter isId is true, this method declares the specified attribute to be a user-determined I...
DOMElement::hasAttributeNS
virtual bool hasAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const =0
Returns true when an attribute with a given local name and namespace URI is specified on this element...
DOMElement::getAttribute
virtual const XMLCh * getAttribute(const XMLCh *name) const =0
Retrieves an attribute value by name.
DOMElement::getAttributeNS
virtual const XMLCh * getAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const =0
Retrieves an attribute value by local name and namespace URI.
DOMElement::getTagName
virtual const XMLCh * getTagName() const =0
The name of the element.
DOMElement::getAttributeNodeNS
virtual DOMAttr * getAttributeNodeNS(const XMLCh *namespaceURI, const XMLCh *localName) const =0
Retrieves an DOMAttr node by local name and namespace URI.
DOMElement::getChildElementCount
virtual XMLSize_t getChildElementCount() const =0
The number of child nodes that are of type DOMElement.
DOMElement::getAttributeNode
virtual DOMAttr * getAttributeNode(const XMLCh *name) const =0
Retrieves an DOMAttr node by name.
DOMElement::DOMElement
DOMElement()
Definition DOMElement.hpp:73
DOMElement::hasAttribute
virtual bool hasAttribute(const XMLCh *name) const =0
Returns true when an attribute with a given name is specified on this element or has a default value,...
DOMElement::removeAttributeNode
virtual DOMAttr * removeAttributeNode(DOMAttr *oldAttr)=0
Removes the specified attribute node.
DOMElement::getFirstElementChild
virtual DOMElement * getFirstElementChild() const =0
The first child of type DOMElement.
DOMElement::removeAttributeNS
virtual void removeAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName)=0
Removes an attribute by local name and namespace URI.
DOMElement::DOMElement
DOMElement(const DOMElement &other)
Definition DOMElement.hpp:74
DOMElement::getSchemaTypeInfo
virtual const DOMTypeInfo * getSchemaTypeInfo() const =0
Returns the type information associated with this element.
DOMElement::getElementsByTagName
virtual DOMNodeList * getElementsByTagName(const XMLCh *name) const =0
Returns a DOMNodeList of all descendant elements with a given tag name, in the order in which they wo...
DOMElement::setIdAttributeNode
virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId)=0
If the parameter isId is true, this method declares the specified attribute to be a user-determined I...
DOMElement::setAttributeNode
virtual DOMAttr * setAttributeNode(DOMAttr *newAttr)=0
Adds a new attribute.
DOMElement::getPreviousElementSibling
virtual DOMElement * getPreviousElementSibling() const =0
The previous sibling node of type DOMElement.
DOMElement::getLastElementChild
virtual DOMElement * getLastElementChild() const =0
The last child of type DOMElement.
DOMElement::getNextElementSibling
virtual DOMElement * getNextElementSibling() const =0
The next sibling node of type DOMElement.
DOMElement::getElementsByTagNameNS
virtual DOMNodeList * getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const =0
Returns a DOMNodeList of all the DOMElements with a given local name and namespace URI in the order i...
DOMElement::setIdAttributeNS
virtual void setIdAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName, bool isId)=0
If the parameter isId is true, this method declares the specified attribute to be a user-determined I...
DOMElement::removeAttribute
virtual void removeAttribute(const XMLCh *name)=0
Removes an attribute by name.
DOMElement::setAttributeNS
virtual void setAttributeNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLCh *value)=0
Adds a new attribute.
DOMNodeList
The DOMNodeList interface provides the abstraction of an ordered collection of nodes.
Definition DOMNodeList.hpp:45
DOMNode
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition DOMNode.hpp:139
DOMTypeInfo
The DOMTypeInfo interface represent a type used by DOMElement or DOMAttr nodes, specified in the sche...
Definition DOMTypeInfo.hpp:36