Skip to content
Titanium SDK
Version12.5.1

You are reading 12.5.1. See this page in 13.4.1.

Titanium.XML.NamedNodeMap

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

Extends Titanium.Proxy

A key-value paired map that maps String objects to Titanium.XML.Node objects. Implements the DOM Level 2 API on Android and iOS.

Properties 4

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

length

Numberread-only

The number of nodes in the map. The valid range of child node indices is 0-length-1, inclusive.

Methods 11

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.

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.

Retrieves a node specified by name.

Parameters
ParametersTypeDescription
nameString

The name of the node to retrieve.

Returns Titanium.XML.Node

The specified node, or null if no node with the name is in the map

Retrieves a node specified by name and namespace. Returns null if no matching node is in the map.

Parameters
ParametersTypeDescription
namespaceURIString

The namespace URI of the node to retrieve.

localNameString

The local name of the node within the namespace to retrieve.

Returns Titanium.XML.Node

The specified node, or null if there is no matching node.

Retrieves the node at the specified index of the map. Note that NamedNodeMaps are not ordered.

Parameters
ParametersTypeDescription
indexNumber

The index of the node to retrieve.

Returns Titanium.XML.Node

The node at the specified index, or null if the index is invalid

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.

Removes a node from the map specified by name. When this map contains attributes attached to an element, if the removed attribtue is known to have a default, it is replaced with that value.

Parameters
ParametersTypeDescription
nameString

The name of the node to remove.

Returns Titanium.XML.Node

The node removed from the map, or null if nothing removed.

Removes a node from the map specified by local name and namespace URI. When this map contains attributes attached to an element, if the removed attribtue is known to have a default, it is replaced with that value. Returns the node removed from the map, or null if there is no corresponding node.

Parameters
ParametersTypeDescription
namespaceURIString

The namespace URI of the node to remove.

localNameString

The local name of the node within the namespace to remove.

Returns Titanium.XML.Node

The node removed from the map, or null if nothing removed.

Adds a node using its nodeName attribute. If a node with that name is already present, it is replaced. Throws an exception if the argument is from a different document, the map is read-only, or the argument is an attribute of another element.

Parameters
ParametersTypeDescription
nodeTitanium.XML.Node

The node to insert into the map.

Returns Titanium.XML.Node

The node replaced, or null if no node was replaced.

Adds a node using its namespaceURI and localName attributes. If a node with that name is already present, it is replaced. Throws an exception if the argument is from a different document, the map is read-only, or the argument is an attribute of another element.

Parameters
ParametersTypeDescription
nodeTitanium.XML.Node

The node to insert into the map.

Returns Titanium.XML.Node

Returns the node replaced, or null.