The GdomeElement interface represents an element in an HTML or XML document.
Elements may have attributes associated with them; since the GdomeElement
interface inherits from GdomeNode, the generic GdomeNode interface method
gdome_el_attributes() may be used to retrieve the set of all attributes for an
element. There are methods on the GdomeElement interface to retrieve either an
GdomeAttr object by name or an attribute value by name.
In XML, where an attribute value may contain entity references, an GdomeAttr
object should be retrieved to examine the possibly fairly complex sub-tree
representing the attribute value. On the other hand, in HTML, where all
attributes have simple string values, methods to directly access an attribute
value can safely be used as a convenience.
Removes an attribute by name. If the removed attribute is known to have a
default value, an attribute immediately appears containing the default
value as well as the corresponding namespace URI, local name, and prefix
when applicable.
To remove an attribute by local name and namespace URI, use the
gdome_el_removeAttributeNS() function.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
Adds a new attribute node. If an attribute with that name is already present
in the element, it is replaced by the new one.
To add a new attribute node with a qualified name and namespace URI, use the
gdome_el_setAttributeNodeNS() method.
GDOME_WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different
document than the one that created the element.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
GDOME_INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of
another Element object. The DOM user must explicitly clone Attr nodes to
re-use them in other elements.
self :
Element Object ref
newAttr :
The Attr node to add to the attribute list
exc :
Exception Object ref
Returns :
if the newAttr attribute replaces an existing attribute, the
replaced Attr node is returned, otherwise NULL is returned.
Removes the specified attribute node. If the removed Attr has a default
value it is immediately replaced. The replacing attribute has the same
namespace URI and local name, as well as the original prefix, when
applicable.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
GDOME_NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
Adds a new attribute. If an attribute with the same namespaceURI and
localName is already present in the element, its value is changed to be
that of the value parameter.
GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the
qualifiedName has a prefix and the namespaceURI is NULL, if the
qualifiedNamenamespaceURI is different
from "http://www.w3.org/XML/1998/namespace", or if the qualifiedName is
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
self :
Element Objects ref
namespaceURI :
The namespace URI of attribute to create or alter
qualifiedName :
The qualifiedName of the attribute to create or alter
Removes an attribute by local name and namespace URI. If the removed
attribute has a default value it is immediately replaced. The replacing
attribute has the same namespace URI and local name, as well as the
original prefix.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
Adds a new attribute. If an attribute with that local name and that
namespace URI is already present in the element, it is replaced by the new
one.
GDOME_WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different
document than the one that created the element.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
GDOME_INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of
another Element object. The DOM user must explicitly clone Attr nodes to
re-use them in other elements.
self :
Element Object ref
newAttr :
The Attr node to add to the attribute list
exc :
Exception Object ref
Returns :
if the newAttr attribute replaces an existing attribute with the
same local name and namespace URI, the replaced Attr node is returned,
otherwise NULL is returned.
The namespace URI of the elements to match on. The special
value * matches all namespaces.
localName :
The local name of the elements to match on. The special value
* matches all local names.
exc :
Exception Object ref
Returns :
a NodeList of all the descendant elements with a given local name
and namespace URI in the order in which they are encountered in a preorder
traversal of this Element tree.
the parent of this node. All nodes, except Attr,
Document, DocumentFragment, Entity, and Notation may have a parent. However,
if a node has just been created and not yet added to the tree, or if it has
been removed from the tree, this is NULL.
a NodeList that contains all children of this node. If there are no
children, this is a NodeList containing no nodes. Note that attributes are
not considered to be children of element nodes - use gdome_n_attributes to
obtain the attributes.
the documment object associated with this node. This is also the
Document object used to create new nodes. When this node is a Document or a
DocumentType which is not used with any Document yet, this is NULL.
Inserts the node newChild before the existing child node refChild. If
refChild is NULL, insert newChild at the end of the list of children.
If newChild is a DocumentFragment node, all of its children are inserted,
in the same order, before refChild. If the newChild is already in the
tree, it is first removed.
GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild node, or if the node to insert is
one of this node's ancestors or this node itself.
GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different
document than the one that created this node.
GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
self :
Node Object ref
newChild :
The new node to put in the child list
refChild :
the reference node, i.e., the node before which the new node
must be inserted.
Replaces the child node oldChild with newChild in the list of children,
and returns the oldChild node. If newChild is a DocumentFragment object,
oldChild is replaced by all of the DocumentFragment children, which are
inserted in the same order. If the newChild is already in the tree, it is
first removed.
GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does
not allow children of the type of the newChild node, or if the node to put
in is one of this node's ancestors or this node itself.
GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different
document than the one that created this node.
GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
Adds the node newChild to the end of the list of children of this node.
If the newChild is already in the tree, it is first removed. If it is a
DocumentFragment node, the entire contents of the document fragment are
moved into the child list of this node
GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild node, or if the node to append is
one of this node's ancestors or this node itself.
GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different
document than the one that created this node.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
Makes a duplicate of this node, i.e., serves as a generic copy
constructor for nodes. The duplicate node has no parent; (parentNode is
NULL).
GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE
nodes are not supported.
GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not
supported.
self :
Node Object ref
deep :
If true, recursively clone the subtree under the specified node;
if false, clone only the node itself (and its attributes, if it is
an Element).
Puts all Text nodes in the full depth of the sub-tree underneath this Node,
including attribute nodes, into a "normal" form where only structure (e.g.,
elements, comments, processing instructions, CDATA sections, and entity
references) separates Text nodes, i.e., there are neither adjacent Text
nodes nor empty Text nodes.
Tests whether the DOM implementation implements a specific feature and that
feature is supported by this node.
self :
Node Object ref
feature :
The name of the feature to test.
version :
This is the version number of the feature to test. In Level 2,
version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return TRUE.
exc :
Exception Object ref
Returns :
TRUE if the specified feature is supported on this node, FALSE
otherwise.
the namespace URI of this node, or NULL if it is unspecified.
For nodes of any type other than GDOME_ELEMENT_NODE and
GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is
always NULL.
the namespace prefix of this node, or NULL if it is unspecified.
For nodes of any type other than GDOME_ELEMENT_NODE and
GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is
always NULL.
GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the
Namespaces in XML specification, if the namespaceURI of this node is NULL,
different from "http://www.w3.org/XML/1998/namespace", if this node is an
>
the local part of the qualified name of this node.
For nodes of any type other than GDOME_ELEMENT_NODE and
GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is
always NULL.
This method allows the registration of event listeners on the event target.
If an EventListener is added to an EventTarget while it is processing an
event, it will not be triggered by the current actions but may be triggered
during a later stage of event flow, such as the bubbling phase.
If multiple identical EventListeners are registered on the same EventTarget
with the same parameters the duplicate instances are discarded. They do not
cause the EventListener to be called twice and since they are discarded
they do not need to be removed with the removeEventListener method.
self :
Node Object ref
type :
the event type for which the user is registering
listener :
the listener parameter takes an interface implemented by the
user which contains the methods to be called when the event occurs.
useCapture :
if TRUE, useCapture indicates that the user wishes to initiate
capture. After initiating capture, all events of the specified
type will be dispatched to the registered EventListener before
being dispatched to any EventTargets beneath them in the tree.
Events which are bubbling upward through the tree will not
trigger an EventListener designated to use capture.
This method allows the removal of event listeners from the event target. If
an EventListener is removed from an EventTarget while it is processing an
event, it will not be triggered by the current actions. EventListeners can
never be invoked after being removed. Calling removeEventListener with
arguments which do not identify any currently registered EventListener on
the EventTarget has no effect.
self :
Node Object ref
type :
Specifies the event type of the EventListener being removed.
listener :
The EventListener parameter indicates the EventListener to be
removed.
useCapture :
Specifies whether the EventListener being removed was
registered as a capturing listener or not. If a listener was
registered twice, one with capture and one without, each must
be removed separately. Removal of a capturing listener does
not affect a non-capturing version of the same listener, and
vice versa.
This method allows the dispatch of events into the implementations event
model. Events dispatched in this manner will have the same capturing and
bubbling behavior as events dispatched directly by the implementation. The
target of the event is the EventTarget on which dispatchEvent is called.
GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not
specified by initializing the event before dispatchEvent was called.
Specification of the Event's type as NULL or an empty string will also
trigger this exception.
self :
Node Object ref
evt :
Specifies the event type, behavior, and contextual information to be
used in processing the event.
exc :
Exception Object ref
Returns :
if preventDefault was called the value is FALSE, else the value
is TRUE.
This method allows the dispatch of events into the implementations event
model. Events dispatched in this manner will have the same capturing and
bubbling behavior as events dispatched directly by the implementation. The
target of the event is any nodes in the subtree of the EventTarget on which
dispatchEvent is called.
GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not
specified by initializing the event before dispatchEvent was called.
Specification of the Event's type as NULL or an empty string will also
trigger this exception.
self :
Node Object ref
evt :
Specifies the event type, behavior, and contextual information to be
used in processing the event.