DOMElement.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP)
#define XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMNode.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMAttr;
class DOMNodeList;
class DOMTypeInfo;
class CDOM_EXPORT DOMElement: public DOMNode {
protected:
// -----------------------------------------------------------------------
// Hidden constructors
// -----------------------------------------------------------------------
DOMElement() {}
DOMElement(const DOMElement &other) : DOMNode(other) {}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMElement & operator = (const DOMElement &);
public:
// -----------------------------------------------------------------------
// All constructors are hidden, just the destructor is available
// -----------------------------------------------------------------------
virtual ~DOMElement() {};
// -----------------------------------------------------------------------
// Virtual DOMElement interface
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
virtual const XMLCh * getTagName() const = 0;
virtual const XMLCh * getAttribute(const XMLCh *name) const = 0;
virtual DOMAttr * getAttributeNode(const XMLCh *name) const = 0;
virtual DOMNodeList * getElementsByTagName(const XMLCh *name) const = 0;
// -----------------------------------------------------------------------
// Setter methods
// -----------------------------------------------------------------------
virtual void setAttribute(const XMLCh *name,
const XMLCh *value) = 0;
virtual DOMAttr * setAttributeNode(DOMAttr *newAttr) = 0;
virtual DOMAttr * removeAttributeNode(DOMAttr *oldAttr) = 0;
virtual void removeAttribute(const XMLCh *name) = 0;
virtual const XMLCh * getAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const = 0;
virtual void setAttributeNS(const XMLCh *namespaceURI,
const XMLCh *qualifiedName, const XMLCh *value) = 0;
virtual void removeAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName) = 0;
virtual DOMAttr * getAttributeNodeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const = 0;
virtual DOMAttr * setAttributeNodeNS(DOMAttr *newAttr) = 0;
virtual DOMNodeList * getElementsByTagNameNS(const XMLCh *namespaceURI,
const XMLCh *localName) const = 0;
virtual bool hasAttribute(const XMLCh *name) const = 0;
virtual bool hasAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const = 0;
virtual void setIdAttribute(const XMLCh* name, bool isId) = 0;
virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId) = 0;
virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId) = 0;
virtual const DOMTypeInfo* getSchemaTypeInfo() const = 0;
// -----------------------------------------------------------------------
// DOMElementTraversal interface
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
virtual DOMElement * getFirstElementChild() const = 0;
virtual DOMElement * getLastElementChild() const = 0;
virtual DOMElement * getPreviousElementSibling() const = 0;
virtual DOMElement * getNextElementSibling() const = 0;
virtual XMLSize_t getChildElementCount() const = 0;
};
XERCES_CPP_NAMESPACE_END
#endif
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