Table 15-2 summarizes the methods of available through AttrRef
interface.
Table 15-2 Summary of TreeWalker Methods; Dom Package
Function | Summary |
---|---|
AttrRef
|
Constructor. |
getName
|
Return attribute's name. |
getOwnerElement
|
Return attribute's owning element. |
getSpecified
|
Return boolean indicating if an attribute was explicitly created. |
getValue
|
Return attribute's value. |
setValue
|
Set attribute's value. |
~AttrRef
|
Public default destructor. |
Class constructor.
Syntax | Description |
---|---|
AttrRef( const NodeRef< Node>& node_ref, Node* nptr); |
Used to create references to a given attribute node after a call to createAttribute .
|
AttrRef( const AttrRef< Node>& nref); |
Copy constructor. |
Parameter | Description |
---|---|
node_ref |
reference to provide the context |
nptr |
referenced node |
(AttrRef)
Node
reference object
Returns the fully-qualified name of an attribute (in the data encoding) as a NULL
-terminated string.
oratext* getName() const;
(oratext *)
name of attribute
Returns attribute's owning element
Node* getOwnerElement();
(Node*)
attribute's owning element node.
Returns the 'specified' value for an attribute. If the attribute was explicitly given a value in the original document, it is TRUE
; otherwise, it is FALSE
. If the node is not an attribute, returns FALSE
. If the user sets attribute's value through DOM, its 'specified' value will be TRUE
.
boolean getSpecified() const;
(boolean)
attribute's "specified" value
Returns the "value" (character data) of an attribute (in the data encoding) as NULL
-terminated string. Character and general entities will have been replaced.
oratext* getValue() const;
(oratext*)
attribute's value
Sets the given attribute's value to data. The new value must be in the data encoding. It is not verified, converted, or checked. The attribute's 'specified' flag will be TRUE
after setting a new value.
void setValue( oratext* data) throw (DOMException);
Parameter | Description |
---|---|
data |
new value of attribute |
This is the default destructor.
~AttrRef();