Titanium.XML.Element

Object of Titanium.XML.
Platform Since
Android 0.8
iPhone 0.8
iPad 0.8

Summary

Represents an element in a DOM document, a Titanium.XML.Node defined by a start-tag and end-tag (or an empty tag). Elements may have attributes associated with them. This conforms to the DOM Level 2 definition of a DOM Element.

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

appendChild

Appends the node newChild as a child of this node

cloneNode

Returns a duplicate of this node

fireEvent

Fires a synthesized event to any registered listeners.

getAttribute

Retrieves an attribute value by name, returning it as a string.

getAttributeNS

Retrieves an attribute value by local name and namespace URI, returning it as a string.

getAttributeNode

Retrieves an attribute value by name, returning it as a Titanium.XML.Attr object.

getAttributeNodeNS

Retrieves an attribute value by local name and namespace URI, returning it as a Titanium.XML.Attr object.

getElementsByTagName

Retrieves a Titanium.XML.NodeList of all descendant elements with a given tag name, in preorder traversal.

getElementsByTagNameNS

Retrieves a Titanium.XML.NodeList of all descendant elements with a given local name and namespace URI, in preorder traversal.

hasAttribute

Determines whether or not an attribute with the given name is available in the element, or has a default value.

hasAttributeNS

Determines whether or not an attribute with the given name is available in the element, or has a default value.

hasAttributes

Whether or not this node has attributes

hasChildNodes

Whether or not this node has child nodes

insertBefore
isSupported

Tests whether the DOM implementation supports a specific feature

normalize

Normalizes text and attribute nodes in this node's child hierarchy

removeAttribute

Removes an attribute by name. If the attribute has a default value, it is immediately replaced with this default, including namespace URI and local name. Throws an exception if the element is read-only.

removeAttributeNS

Removes an attribute by local name and namespace URI. If the attribute has a default value, it is immediately replaced with this default, including namespace URI and local name. Throws an exception if the element is read-only.

removeAttributeNode

Removes the specified attribute node. If the removed attribute has a default value, it is replaced immediately, with the same namespace and local name as the removed attribute, if applicable. Throws an exception if the element is read-only, or the attribute is not an attribute of the element.

removeChild

Removes a child node from this node

removeEventListener

Removes the specified callback as an event listener for the named event.

replaceChild

Replaces the node oldChild with the node newChild

setAttribute

Adds a new attribute. Any attribute with the same name is replaced. Throws an exception if the element is read-only, or if the name contains an illegal character.

setAttributeNS

Adds a new attribute. Any attribute with the same local name and namespace URI is present on the element is replaced, with its prefix changed to that of the qualifiedName parameter. Throws an exception if the element is read-only, if the name contains an illegal character, or if the qualified name contains an error.

setAttributeNode

Adds a new attribute. Any attribute with the same nodeName as the argument is replaced. Throws an exception if the element is read-only, if newAttr is from a different document, or if newAttr is already an attribute of another element.

setAttributeNodeNS

Adds a new attribute. Any attribute with the same local name and namespace URI is replaced. Throws an exception if the element is read-only, if newAttr is from a different document, or if newAttr is already an attribute of another element.

Properties

Name Type Summary
ATTRIBUTE_NODE Number

The value of when this node is a Titanium.XML.Attr read-only

CDATA_SECTION_NODE Number

The value of when this node is a CData section (a type of Titanium.XML.Text) read-only

COMMENT_NODE Number

The value of when this node is a Titanium.XML.Comment read-only

DOCUMENT_FRAGMENT_NODE Number

The value of when this node is a Titanium.XML.DocumentFragment read-only

DOCUMENT_NODE Number

The value of when this node is a Titanium.XML.Document read-only

DOCUMENT_TYPE_NODE Number

The value of when this node is a Titanium.XML.DocumentType read-only

ELEMENT_NODE Number

The value of when this node is a Titanium.XML.Element read-only

ENTITY_NODE Number

The value of when this node is a Titanium.XML.Entity read-only

ENTITY_REFERENCE_NODE Number

The value of when this node is an Entity reference (a type of Titanium.XML.Node) read-only

NOTATION_NODE Number

The value of when this node is a Titanium.XML.Notation read-only

PROCESSING_INSTRUCTION_NODE Number

The value of when this node is a Titanium.XML.ProcessingInstruction read-only

TEXT_NODE Number

The value of when this node is a Titanium.XML.Text read-only

attributes Titanium.XML.NamedNodeMap

A map of this node's attributes read-only

childNodes Titanium.XML.NodeList

A Titanium.XML.NodeList of this node's children read-only

firstChild Titanium.XML.Node

This node's first child read-only

lastChild Titanium.XML.Node

This node's last child read-only

localName String

The local part of the qualified name of this node

namespaceURI String

The namespace URI of this node read-only

nextSibling Titanium.XML.Node

This node's next sibling read-only

nodeName String

The name of this node read-only

nodeType Number

This node's type. One of , , , , , , , , , , , read-only

nodeValue String

The content (value) of this node read-only

ownerDocument Titanium.XML.Document

This node's owning Document read-only

parentNode Titanium.XML.Node

This node's parent node read-only

prefix String

The namespace prefix of this node read-only

previousSibling Titanium.XML.Node

This node's previous sibling read-only

tagName String

The name of the element, as defined by its tag. read-only

text String

Retrieves all child text nodes as one String read-only

Events

This type has no events.