Titanium.XML.Node
> Titanium.XML.Node

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.

  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify an Attr node. ...

Used with nodeType to identify an Attr node.

Constant value:2

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a CDATASection node. ...

Used with nodeType to identify a CDATASection node.

Constant value:4

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a Comment node. ...

Used with nodeType to identify a Comment node.

Constant value:8

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a DocumentFragment node. ...

Used with nodeType to identify a DocumentFragment node.

Constant value:11

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a Document node. ...

Used with nodeType to identify a Document node.

Constant value:9

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a DocumentType node. ...

Used with nodeType to identify a DocumentType node.

Constant value:10

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify an Element node. ...

Used with nodeType to identify an Element node.

Constant value:1

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify an Entity node. ...

Used with nodeType to identify an Entity node.

Constant value:6

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify an EntityReference node. ...

Used with nodeType to identify an EntityReference node.

Constant value:5

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a Notation node. ...

Used with nodeType to identify a Notation node.

Constant value:12

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a ProcessingInstruction node. ...

Used with nodeType to identify a ProcessingInstruction node.

Constant value:7

Titanium.XML.Node
: Numberreadonly
Used with nodeType to identify a Text node. ...

Used with nodeType to identify a Text node.

Constant value:3

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Titanium.XML.Node
attributes : Titanium.XML.NamedNodeMapreadonly

A map of this node's attributes.

A map of this node's attributes.

As defined by the DOM specification, only Element nodes have attributes. For all other node types, this property is always null.

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

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

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0
Titanium.XML.Node
childNodes : Titanium.XML.NodeListreadonly

A Titanium.XML.NodeList of this node's children.

A Titanium.XML.NodeList of this node's children.

Titanium.XML.Node
firstChild : Titanium.XML.Nodereadonly

This node's first child.

This node's first child.

Titanium.XML.Node
lastChild : Titanium.XML.Nodereadonly

This node's last child.

This node's last child.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Titanium.XML.Node
localName : String

Local part of the qualified name of this node.

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.

Titanium.XML.Node
namespaceURI : Stringreadonly

Namespace URI of this node.

Namespace URI of this node.

Titanium.XML.Node
nextSibling : Titanium.XML.Nodereadonly

This node's next sibling.

This node's next sibling.

Titanium.XML.Node
nodeName : Stringreadonly

Name of this node.

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
Titanium.XML.Node
: Numberreadonly
This node's type. ...

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.

Titanium.XML.Node
nodeValue : String

Content (value) of this node.

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.

Titanium.XML.Node
ownerDocument : Titanium.XML.Documentreadonly

This node's owning document.

This node's owning document.

Note that a node always has an owning document, even if it is not part of the document tree.

For more on node ownership, see ownerDocument issues in the W3C DOM FAQ.

Titanium.XML.Node
parentNode : Titanium.XML.Nodereadonly

This node's parent node.

This node's parent node.

Titanium.XML.Node
prefix : String

Namespace prefix of this node.

Namespace prefix of this node.

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

Titanium.XML.Node
previousSibling : Titanium.XML.Nodereadonly

This node's previous sibling.

This node's previous sibling.

Titanium.XML.Node
: Stringdeprecatedreadonly
Content (value) of all text nodes within this node. ...

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

deprecated since 2.0.0

Use <Titanium.XML.Node.textContent> instead.

  • 0.8
  • 0.8
Titanium.XML.Node
textContent : Stringreadonly

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

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

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

  • 0.8
  • 0.8
Defined By

Methods

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

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

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
Titanium.XML.Node
( newChild ) : Titanium.XML.Node
Appends the node newChild as a child of this node. ...

Appends the node newChild as a child of this node.

On iOS, appendChild is supported on Element nodes only.

Parameters

Returns

Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Titanium.XML.Node
( deep ) : Titanium.XML.Node
Returns a duplicate of this node. ...

Returns a duplicate of this node.

Parameters

  • deep : Boolean

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

Returns

Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

  • name : String

    Name of the event.

  • event : Dictionary

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

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the attributes property. ...

Gets the value of the attributes property.

Returns

Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Titanium.XML.Node
( ) : Boolean
Returns true if this node has attributes. ...

Returns true if this node has attributes.

Returns

  • Boolean

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

Titanium.XML.Node
( ) : Boolean
Returns true if this node has child nodes. ...

Returns true if this node has child nodes.

Returns

  • Boolean

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

Titanium.XML.Node
( newChild, refChild ) : Titanium.XML.Node
Inserts the node newChild before the node refChild. ...

Inserts the node newChild before the node refChild.

On iOS, insertBefore is supported on Element nodes only.

Parameters

Returns

Titanium.XML.Node
( feature, version ) : Boolean
Tests whether the DOM implementation supports a specific feature. ...

Tests whether the DOM implementation supports a specific feature.

Parameters

  • feature : String

    Name of the feature.

  • version : String

    Version number of the feature.

Returns

  • Boolean

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

Titanium.XML.Node
( )
Normalizes text and attribute nodes in this node's child hierarchy. ...

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

  • 0.8

Returns

  • void
Titanium.XML.Node
( oldChild ) : Titanium.XML.Node
Removes a child node from this node. ...

Removes a child node from this node.

On iOS, removeChild is supported on Element nodes only.

Parameters

Returns

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

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

Multiple listeners can be registered for the same event, so the callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

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

Returns

  • void
Titanium.XML.Node
( newChild, oldChild ) : Titanium.XML.Node
Replaces the node oldChild with the node newChild. ...

Replaces the node oldChild with the node newChild.

On iOS, replaceChild is supported on Element nodes only.

Parameters

Returns

Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void