Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::XML::Attr Class Reference

#include <Attr.h>

Inheritance diagram for Poco::XML::Attr:

Poco::XML::AbstractNode Poco::XML::Node Poco::XML::EventTarget Poco::XML::DOMObject

List of all members.

Detailed Description

The Attr interface represents an attribute in an Element object. Typically the allowable values for the attribute are defined in a document type definition.

Attr objects inherit the Node interface, but since they are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the Node attributes parentNode, previousSibling, and nextSibling have a null value for Attr objects. The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with; this should make it more efficient to implement such features as default attributes associated with all elements of a given type. Furthermore, Attr nodes may not be immediate children of a DocumentFragment. However, they can be associated with Element nodes contained within a DocumentFragment. In short, users and implementors of the DOM need to be aware that Attr nodes have some things in common with other objects inheriting the Node interface, but they also are quite distinct.

The attribute's effective value is determined as follows: if this attribute has been explicitly assigned any value, that value is the attribute's effective value; otherwise, if there is a declaration for this attribute, and that declaration includes a default value, then that default value is the attribute's effective value; otherwise, the attribute does not exist on this element in the structure model until it has been explicitly added. Note that the nodeValue attribute on the Attr instance can also be used to retrieve the string version of the attribute's value(s).

In XML, where the value of an attribute can contain entity references, the child nodes of the Attr node provide a representation in which entity references are not expanded. These child nodes may be either Text or EntityReference nodes. Because the attribute type may be unknown, there are no tokenized attribute values.

Definition at line 53 of file Attr.h.

Public Types

enum  {

Public Member Functions

void addEventListener (const XMLString &type, EventListener *listener, bool useCapture)
NodeappendChild (Node *newChild)
NamedNodeMapattributes () const
virtual void autoRelease ()
NodeListchildNodes () const
NodecloneNode (bool deep) const
bool dispatchEvent (Event *evt)
void duplicate () const
NodefirstChild () const
const XMLString & getNodeValue () const
 Returns the value of this node, depending on its type.
const XMLString & getValue () const
bool hasAttributes () const
 Returns the local name of the node.
bool hasChildNodes () const
XMLString innerText () const
 Returns whether this node (if it is an element) has any attributes.
NodeinsertBefore (Node *newChild, Node *refChild)
bool isSupported (const XMLString &feature, const XMLString &version) const
NodelastChild () const
const XMLString & localName () const
 Returns the namespace prefix from the qualified name of the node.
const XMLString & name () const
const XMLString & namespaceURI () const
NodenextSibling () const
const XMLString & nodeName () const
unsigned short nodeType () const
const XMLString & nodeValue () const
 Returns the name of this node, depending on its type.
void normalize ()
DocumentownerDocument () const
ElementownerElement () const
NodeparentNode () const
XMLString prefix () const
NodepreviousSibling () const
void release () const
 Increases the object's reference count.
NoderemoveChild (Node *oldChild)
void removeEventListener (const XMLString &type, EventListener *listener, bool useCapture)
NodereplaceChild (Node *newChild, Node *oldChild)
void setNodeValue (const XMLString &value)
 Returns the value of this node, depending on its type.
void setValue (const XMLString &value)
bool specified () const
 Returns the name of this attribute.
const XMLString & value () const

Protected Member Functions

 Attr (Document *pOwnerDocument, const Attr &attr)
 Attr (Document *pOwnerDocument, Element *pOwnerElement, const XMLString &namespaceURI, const XMLString &localName, const XMLString &qname, const XMLString &value, bool specified=true)
void bubbleEvent (Event *evt)
void captureEvent (Event *evt)
NodecopyNode (bool deep, Document *pOwnerDocument) const
void dispatchAttrModified (Attr *pAttr, MutationEvent::AttrChangeType changeType, const XMLString &prevValue, const XMLString &newValue)
void dispatchCharacterDataModified (const XMLString &prevValue, const XMLString &newValue)
void dispatchNodeInserted ()
virtual void dispatchNodeInsertedIntoDocument ()
void dispatchNodeRemoved ()
virtual void dispatchNodeRemovedFromDocument ()
void dispatchSubtreeModified ()
virtual bool events () const
virtual bool eventsSuspended () const
void setOwnerDocument (Document *pOwnerDocument)

Static Protected Attributes

static const XMLString EMPTY_STRING

Private Attributes

const Name_name
bool _specified
XMLString _value


class Document
class DOMBuilder
class Element

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index