ElementRef

Used to create references to a given element node after a call to createElement.

ElementRef(
const ElementRef< Node>& node_ref);

Copy constructor.

Parameter

Description

node_ref

reference to provide the context

nptr

referenced node

Returns

(ElementRef)Node reference object

getAttribute

Returns the value of an element's attribute (specified by name). Note that an attribute may have the empty string as its value, but cannot be NULL.

Syntax

oratext* getAttribute(
oratext* name) const;

Parameter

Description

name

name of attribute (data encoding)

Returns

(oratext*) named attribute's value (in data encoding)

getAttributeNS

Returns the value of an element's attribute (specified by URI and local name). Note that an attribute may have the empty string as its value, but cannot be NULL.

Syntax

oratext* getAttributeNS(
oratext* namespaceURI,
oratext* localName);

Parameter

Description

namespaceURI

namespace URI of attribute (data encoding)

localName

local name of attribute (data encoding)

Returns

(oratext *) named attribute's value (in data encoding)

getAttributeNode

Returns the attribute node given its name.

Syntax

Node* getAttributeNode(
oratext* name) const;

Parameter

Description

name

name of attribute (data encoding)

Returns

(Node*) the attribute node

getElementsByTagName

Returns a list of all elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the subtree. The tag name should be in the data encoding. The special name "*" matches all tag names; a NULL name matches nothing. Tag names are case sensitive. This function is not namespace aware; the full tag names are compared. The returned list should be freed by the user.

Syntax

NodeList< Node>* getElementsByTagName(
oratext* name);

Parameter

Description

name

tag name to match (data encoding)

Returns

(NodeList< Node>*) the list of elements

getTagName

Returns the tag name of an element node which is supposed to have the same value as the node name from the node interface

Syntax

oratext* getTagName() const;

Returns

(oratext*) element's name [in data encoding]

hasAttribute

Determines if an element has a attribute with the given name

Syntax

boolean hasAttribute(
oratext* name);

Parameter

Description

name

name of attribute (data encoding)

Returns

(boolean)TRUE if element has attribute with given name

hasAttributeNS

Determines if an element has a attribute with the given URI and local name

Syntax

boolean hasAttributeNS(
oratext* namespaceURI,
oratext* localName);

Parameter

Description

namespaceURI

namespace URI of attribute (data encoding)

localName

local name of attribute (data encoding)

Returns

(boolean)TRUE if element has such attribute

removeAttribute

Removes an attribute specified by name. The attribute is removed from the element's list of attributes, but the attribute node itself is not destroyed.

Syntax

void removeAttribute(
oratext* name) throw (DOMException);

Parameter

Description

name

name of attribute (data encoding)

removeAttributeNS

Removes an attribute specified by URI and local name. The attribute is removed from the element's list of attributes, but the attribute node itself is not destroyed.

setAttribute

Creates a new attribute for an element with the given name and value (which should be in the data encoding). If the named attribute already exists, its value is simply replaced. The name and value are not verified, converted, or checked. The value is not parsed, so entity references will not be expanded.

setAttributeNS

Creates a new attribute for an element with the given URI, local name and value (which should be in the data encoding). If the named attribute already exists, its value is simply replaced. The name and value are not verified, converted, or checked. The value is not parsed, so entity references will not be expanded.

setAttributeNode

Adds a new attribute to an element. If an attribute with the given name already exists, it is replaced and a pointer to the old attribute returned. If the attribute is new, it is added to the element's list and a pointer to the new attribute is returned.