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
27
29
30
31class DOMAttr;
32class DOMNodeList;
33class DOMTypeInfo;
34
35
67protected:
68 // -----------------------------------------------------------------------
69 // Hidden constructors
70 // -----------------------------------------------------------------------
74 DOMElement(const DOMElement &other) : DOMNode(other) {}
76
77private:
78 // -----------------------------------------------------------------------
79 // Unimplemented constructors and operators
80 // -----------------------------------------------------------------------
83 DOMElement & operator = (const DOMElement &);
85
86public:
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
501
508 virtual DOMElement * getNextElementSibling() const = 0;
509
519 virtual XMLSize_t getChildElementCount() const = 0;
521};
522
524
525#endif
526
527
528
#define CDOM_EXPORT
Definition XercesDefs.hpp:166
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
uint16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
The DOMAttr class refers to an attribute of an XML element.
Definition DOMAttr.hpp:57
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition DOMElement.hpp:66
virtual DOMAttr * setAttributeNodeNS(DOMAttr *newAttr)=0
Adds a new attribute.
virtual void setAttribute(const XMLCh *name, const XMLCh *value)=0
Adds a new attribute.
virtual ~DOMElement()
Destructor.
Definition DOMElement.hpp:96
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...
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...
virtual const XMLCh * getAttribute(const XMLCh *name) const =0
Retrieves an attribute value by name.
virtual const XMLCh * getAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const =0
Retrieves an attribute value by local name and namespace URI.
virtual const XMLCh * getTagName() const =0
The name of the element.
virtual DOMAttr * getAttributeNodeNS(const XMLCh *namespaceURI, const XMLCh *localName) const =0
Retrieves an DOMAttr node by local name and namespace URI.
virtual XMLSize_t getChildElementCount() const =0
The number of child nodes that are of type DOMElement.
virtual DOMAttr * getAttributeNode(const XMLCh *name) const =0
Retrieves an DOMAttr node by name.
DOMElement()
Definition DOMElement.hpp:73
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,...
virtual DOMAttr * removeAttributeNode(DOMAttr *oldAttr)=0
Removes the specified attribute node.
virtual DOMElement * getFirstElementChild() const =0
The first child of type DOMElement.
virtual void removeAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName)=0
Removes an attribute by local name and namespace URI.
DOMElement(const DOMElement &other)
Definition DOMElement.hpp:74
virtual const DOMTypeInfo * getSchemaTypeInfo() const =0
Returns the type information associated with this element.
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...
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...
virtual DOMAttr * setAttributeNode(DOMAttr *newAttr)=0
Adds a new attribute.
virtual DOMElement * getPreviousElementSibling() const =0
The previous sibling node of type DOMElement.
virtual DOMElement * getLastElementChild() const =0
The last child of type DOMElement.
virtual DOMElement * getNextElementSibling() const =0
The next sibling node of type DOMElement.
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...
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...
virtual void removeAttribute(const XMLCh *name)=0
Removes an attribute by name.
virtual void setAttributeNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLCh *value)=0
Adds a new attribute.
The DOMNodeList interface provides the abstraction of an ordered collection of nodes.
Definition DOMNodeList.hpp:45
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition DOMNode.hpp:139
The DOMTypeInfo interface represent a type used by DOMElement or DOMAttr nodes, specified in the sche...
Definition DOMTypeInfo.hpp:36