Skip to content
Titanium SDK
Version12.5.1

You are reading 12.5.1. See this page in 13.4.1.

Titanium.XML.Node

proxyAndroidiPhoneiPadmacOSsince Android 0.9, iPhone 0.9, iPad 0.9, macOS 9.2.0

Extends Titanium.Proxy

Extended by Titanium.XML.AttrTitanium.XML.CharacterDataTitanium.XML.DocumentTitanium.XML.DocumentFragmentTitanium.XML.DocumentTypeTitanium.XML.ElementTitanium.XML.EntityTitanium.XML.EntityReference

A single node in the Document tree.

Implements the DOM Level 2 API on Android and iOS.

Note that on iOS, only Element nodes are mutable. This means that the methods appendChild, insertBefore, removeChild, and replaceChild only work on Element objects. If one of these methods is called on another type of node, it throws an exception.

Properties 31

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

localName

String

Local part of the qualified name of this node.

The local part of the qualified name that comes after the colon. That is, the name without the namespace prefix.

nodeName

Stringread-only

Name of this node.

Certain node types have constant values defined by the DOM specification:

  • Text node: #text
  • Comment node: #comment
  • CDATA section node: #cdata-section
  • Document node: #document
  • Document fragment node: #document-fragment

nodeType

Numberread-only

This node's type. One of ELEMENT_NODE, ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE, ENTITY_NODE, PROCESSING_INSTRUCTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NOTATION_NODE.

nodeValue

String

Content (value) of this node.

As defined in the DOM specification, the node value is always null for Document, DocumentFragment, DocumentType, Element, Entity, EntityReference, and Notation nodes.

prefix

String

Namespace prefix of this node.

Read-only on iOS, read-write on other platforms.

textContent

StringiPhoneiPadmacOSread-only

Content (value) of all text nodes within this node.

On Android, textContent is supported on Element and Text nodes only.

Methods 13

Inherited from Titanium.Proxy

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

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Returns a duplicate of this node.

Parameters
ParametersTypeDescription
deepBoolean

Whether or not to perform a deep copy of this node.

Returns Titanium.XML.Node

Cloned node.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Returns true if this node has attributes.

Returns Boolean

True if this node has attributes, false if it does not.

Returns true if this node has child nodes.

Returns Boolean

True if this node has children, false if it does not.

Tests whether the DOM implementation supports a specific feature.

Parameters
ParametersTypeDescription
featureString

Name of the feature.

versionString

Version number of the feature.

Returns Boolean

True if the feature is supported, false if it is not.

normalize

Android

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

Inherited from Titanium.Proxy

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

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.