You are reading 12.6.1. See this page in 13.4.1.
Titanium.XML.Document
Extends Titanium.XML.NodeTitanium.Proxy
The DOM Document returned from Titanium.XML.parseString.
Implements the DOM Level 2 API on Android and iOS.
As of version 3.1, Android does not truly support DTDs. A document with a DTD can be parsed, however it is not validated, its default attributes are not be automatically added into the DOM tree, and so on.
This has been reported as Android Issue #7395.
Properties 34
Inherited from Titanium.Proxy
The name of the API that this proxy corresponds to.
Inherited from Titanium.XML.Node
Value 2
Inherited from Titanium.XML.Node
A map of this node's attributes.
Inherited from Titanium.Proxy
Indicates if the proxy will bubble an event to its parent.
Default: true
Inherited from Titanium.XML.Node
Used with nodeType to identify a CDATASection node.
Value 4
Inherited from Titanium.XML.Node
A Titanium.XML.NodeList of this node's children.
Inherited from Titanium.XML.Node
Value 8
An interface to the list of entities that are defined for the document, such as via a Document Type Definition (DTD).
See note about Android and DTDs.
Inherited from Titanium.XML.Node
Used with nodeType to identify a DocumentFragment node.
Value 11
Inherited from Titanium.XML.Node
Value 9
Inherited from Titanium.XML.Node
Used with nodeType to identify a DocumentType node.
Value 10
Root element of this document.
Inherited from Titanium.XML.Node
Value 1
Inherited from Titanium.XML.Node
Value 6
Inherited from Titanium.XML.Node
Used with nodeType to identify an EntityReference node.
Value 5
Inherited from Titanium.XML.Node
This node's first child.
DOMImplementation object associated with this document.
Inherited from Titanium.XML.Node
This node's last child.
Inherited from Titanium.Proxy
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
localName
StringInherited from Titanium.XML.Node
Local part of the qualified name of this node.
Inherited from Titanium.XML.Node
Namespace URI of this node.
Inherited from Titanium.XML.Node
This node's next sibling.
Inherited from Titanium.XML.Node
Name of this node.
Inherited from Titanium.XML.Node
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
StringInherited from Titanium.XML.Node
Content (value) of this node.
Inherited from Titanium.XML.Node
Value 12
Inherited from Titanium.XML.Node
This node's owning document.
Inherited from Titanium.XML.Node
This node's parent node.
prefix
StringInherited from Titanium.XML.Node
Namespace prefix of this node.
Inherited from Titanium.XML.Node
This node's previous sibling.
Inherited from Titanium.XML.Node
Used with nodeType to identify a ProcessingInstruction node.
Value 7
Inherited from Titanium.XML.Node
Deprecated since 2.0.0
Use Titanium.XML.Node.textContent instead.
Content (value) of all text nodes within this node.
Inherited from Titanium.XML.Node
Value 3
Inherited from Titanium.XML.Node
Content (value) of all text nodes within this node.
Methods 27
Inherited from Titanium.Proxy
Adds the specified callback as an event listener for the named event.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| callback | Callback<Titanium.Event> | Callback function to invoke when the event is fired. 4 fields
|
Inherited from Titanium.XML.Node
Appends the node newChild as a child of this node.
| Parameters | Type | Description |
|---|---|---|
| newChild | Titanium.XML.Node | New node to append. |
applyProperties
since 3.0.0Inherited from Titanium.Proxy
Applies the properties to the proxy.
| Parameters | Type | Description |
|---|---|---|
| props | Dictionary | A dictionary of properties to apply. |
Inherited from Titanium.XML.Node
Returns a duplicate of this node.
| Parameters | Type | Description |
|---|---|---|
| deep | Boolean | Whether or not to perform a deep copy of this node. |
Creates an attribute with the given name.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name for the new attribute. |
Creates an attribute with the given name and namespace.
| Parameters | Type | Description |
|---|---|---|
| namespaceURI | String | Namespace URI for the new attribute. |
| name | String | Qualified name for the new attribute (can include a prefix). |
Creates and returns a CDATASection.
| Parameters | Type | Description |
|---|---|---|
| data | String | String data to go into the CDATA section. |
CDATA section with the given data, ready to be added to an element.
Creates a Comment with the supplied string data.
| Parameters | Type | Description |
|---|---|---|
| data | String | Comment text. |
Creates an empty DocumentFragment.
Creates an element with the given tag name.
| Parameters | Type | Description |
|---|---|---|
| tagName | String | Name for the created element. |
Create a new element with the given namespace and name.
| Parameters | Type | Description |
|---|---|---|
| namespaceURI | String | URI for the namespace the new element belongs to. |
| name | String | Qualified for the new element (can include a prefix). |
Creates an EntityReference with the given name.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name for the new entity reference. |
Creates a processing instruction for inserting into the DOM tree.
| Parameters | Type | Description |
|---|---|---|
| target | String | Target part for the processing instruction. |
| data | String | Data for the processing instruction node. |
Creates a text node.
| Parameters | Type | Description |
|---|---|---|
| data | String | The string value for the text node. |
Inherited from Titanium.Proxy
Fires a synthesized event to any registered listeners.
| Parameters | Type | Description |
|---|---|---|
| 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 an Element that has an ID attribute with the given value.
| Parameters | Type | Description |
|---|---|---|
| elementId | String | A unique ID value for an element to search for. |
Returns a node list of elements in the document which have the given tag.
| Parameters | Type | Description |
|---|---|---|
| tagname | String | Tag name to search for. |
Returns a node list of elements in the document which belong to the given namespace and have the given tag name.
| Parameters | Type | Description |
|---|---|---|
| namespaceURI | String | Namespace URI used for matching elements. |
| localname | String | Tag name to search for. |
List of elements in the document which belong to the given namespace and have the given tag name.
Inherited from Titanium.XML.Node
Returns true if this node has attributes.
True if this node has attributes, false if it does not.
Inherited from Titanium.XML.Node
Returns true if this node has child nodes.
True if this node has children, false if it does not.
Imports a node from another document to this document, without altering or removing the source node from the original document.
This method creates a new copy of the source node, ready to be inserted into
this document. The returned node has an ownerDocument
property that points to this document, but its parentNode
property is null, since it has not been inserted into the current document.
For more on node ownership, see ownerDocument issues in the W3C DOM FAQ.
| Parameters | Type | Description |
|---|---|---|
| importedNode | Titanium.XML.Node | Node to import. |
| deep | Boolean | If true, recursively import the subtree under the specified node; if false, import only the node itself. |
Inherited from Titanium.XML.Node
Inserts the node newChild before the node refChild.
| Parameters | Type | Description |
|---|---|---|
| newChild | Titanium.XML.Node | Node to insert. |
| refChild | Titanium.XML.Node | Node to insert |
Inherited from Titanium.XML.Node
Tests whether the DOM implementation supports a specific feature.
| Parameters | Type | Description |
|---|---|---|
| feature | String | Name of the feature. |
| version | String | Version number of the feature. |
True if the feature is supported, false if it is not.
normalize
AndroidInherited from Titanium.XML.Node
Normalizes text and attribute nodes in this node's child hierarchy.
Inherited from Titanium.XML.Node
Removes a child node from this node.
| Parameters | Type | Description |
|---|---|---|
| oldChild | Titanium.XML.Node | Node to remove. |
Inherited from Titanium.Proxy
Removes the specified callback as an event listener for the named event.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| callback | Callback<Titanium.Event> | Callback function to remove. Must be the same function passed to 4 fields
|
Inherited from Titanium.XML.Node
Replaces the node oldChild with the node newChild.
| Parameters | Type | Description |
|---|---|---|
| newChild | Titanium.XML.Node | New node. |
| oldChild | Titanium.XML.Node | Node being replaced. |