DOCUMENTS 5 - PortalScripting API
|
An object of this class represents a HTML or XML element in the DOM. More...
Public Member Functions | |
String | getAttribute (String name) |
Get the string value of an attribute of this element. More... | |
DOMAttr | getAttributeNode (String name) |
Get an attribute of this element. More... | |
DOMNodeList | getElementsByTagName (String tagName) |
List all DOMElements in the subtree with a certain tag name. More... | |
void | removeAttribute (String name) |
Remove an attribute from this element by name. More... | |
DOMAttr | removeAttributeNode (DOMAttr oldAttr) |
Remove an attribute node from this element. More... | |
void | setAttribute (String name, String value) |
Set an attribute of this element by string. More... | |
DOMAttr | setAttributeNode (DOMAttr newAttr) |
Attach an attribute node to this element. More... | |
![]() | |
DOMNode | appendChild (DOMNode newChild) |
Append a new node to the list of child nodes. More... | |
DOMNode | cloneNode (boolean deep) |
Create a duplicate of this node. More... | |
boolean | hasAttributes () |
Test, whether a node has got any associated attributes. More... | |
boolean | hasChildNodes () |
Test, whether a node has got any associated child nodes. More... | |
DOMNode | insertBefore (DOMNode newChild, DOMNode refChild) |
Insert a new node into the list of child nodes. More... | |
void | normalize () |
Normalize the node ans its subtree. More... | |
DOMNode | removeChild (DOMNode oldChild) |
Remove a node from the list of child nodes. More... | |
DOMNode | replaceChild (DOMNode newChild, DOMNode oldChild) |
Replace a node in the list of child nodes. More... | |
Public Attributes | |
String | tagName |
The name of the element. More... | |
![]() | |
DOMNamedNodeMap | attributes |
A map of DOM attributes. If this node is not a DOMElement, the value is null . The property is readonly. | |
DOMNodeList | childNodes |
A list of all children of this node. The property is readonly. | |
DOMNode | firstChild |
The first child node, otherwise null . The property is readonly. | |
DOMNode | lastChild |
The last child node, otherwise null . The property is readonly. | |
DOMNode | nextSibling |
The next sibling node, otherwise null . The property is readonly. | |
String | nodeName |
The name of this node. The property is readonly. | |
Integer | nodeType |
The type or subclass of a this node, encoded as an integer. The property is readonly. | |
String | nodeValue |
The value of the node, which depends on the type. More... | |
DOMDocument | ownerDocument |
The document, which owns this node. The property is readonly. | |
DOMNode | parentNode |
The parent node or null . The property is readonly. | |
DOMNode | previousSibling |
The previous sibling node, otherwise null . The property is readonly. | |
Integer | ELEMENT_NODE |
Constant for the nodeType "Element". The actual subclass is DOMElement. | |
Integer | ATTRIBUTE_NODE |
Constant for the nodeType "Attr". The actual subclass is DOMAttr. | |
Integer | TEXT_NODE |
Constant for the nodeType "Text". The actual subclass is DOMCharacterData, differing from the standard. | |
Integer | CDATA_SECTION_NODE |
Constant for the nodeType "CDATASection". The actual subclass is DOMCharacterData, differing from the standard. | |
Integer | ENTITY_REFERENCE_NODE |
Constant for the nodeType "EntityReference". The actual implementation does not provide a subclass for this type. | |
Integer | ENTITY_NODE |
Constant for the nodeType "Entity". The actual implementation does not provide a subclass for this type. | |
Integer | PROCESSING_INSTRUCTION_NODE |
Constant for the nodeType "ProcessingInstruction". The actual implementation does not provide a subclass for this type. | |
Integer | COMMENT_NODE |
Constant for the nodeType "Comment". The actual subclass is DOMCharacterData, differing from the standard. | |
Integer | DOCUMENT_NODE |
Constant for the nodeType "Document". The actual subclass is DOMDocument. | |
Integer | DOCUMENT_TYPE_NODE |
Constant for the nodeType "DocumentType". The actual implementation does not provide a subclass for this type. | |
Integer | DOCUMENT_FRAGMENT_NODE |
Constant for the nodeType "DocumentFragment". The actual implementation does not provide a subclass for this type. | |
Integer | NOTATION_NODE |
Constant for the nodeType "Notation". The actual implementation does not provide a subclass for this type. | |
An object of this class represents a HTML or XML element in the DOM.
DOMElements cannot be created directly. This applies to all kinds of DOMNodes.
Remarks about W3C conformity
The class covers the Element interface of DOM level 1. The underlying native library already supports at least level 2.
String DOMElement::getAttribute | ( | String | name | ) |
Get the string value of an attribute of this element.
name | The name of the attribute |
DOMAttr DOMElement::getAttributeNode | ( | String | name | ) |
Get an attribute of this element.
name | The attribute's name |
null
. DOMNodeList DOMElement::getElementsByTagName | ( | String | tagName | ) |
List all DOMElements in the subtree with a certain tag name.
The order of the elements in the returned list corresponds to a preorder traversal of the DOM tree.
tagName | The name to match on. The special value "*" matches all tags. |
void DOMElement::removeAttribute | ( | String | name | ) |
Remove an attribute from this element by name.
name | The attribute's name |
DOMException |
Remove an attribute node from this element.
oldAttr | The attribute object to remove |
DOMException |
void DOMElement::setAttribute | ( | String | name, |
String | value | ||
) |
Set an attribute of this element by string.
If an attribute of the given name exists, the method only updates its value. Otherwise it creates the attribute.
name | The attribute's name |
value | The new value of the attribute |
DOMException |
Attach an attribute node to this element.
newAttr | The DOMAttr object, which defines the attribute to add or replace. |
null
. DOMException |
String DOMElement::tagName |
The name of the element.
This property is readonly.