Titanium.XML.CDATASection
Used to include blocks of literal text containing characters that would otherwise need to be escaped.
Implements the DOM Level 2 API on Android and iOS with some non-standard extensions.
Extends: Titanium.XML.Text · Since: 0.9, 0.9, 0.9, 9.2.0 · Platforms: android, iphone, ipad, macos
Properties #
apiName#
Type: String
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.
attributes#
Type: Titanium.XML.NamedNodeMap
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.
bubbleParent#
Type: Boolean
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.
data#
Type: String
The character data of the node that implements this interface. Throws an exception during setting if this node is readonly.
length#
Type: Number
The number of characters that are available through data and the substringData method. This may have the value zero, i.e., Titanium.XML.CharacterData may be empty.
lifecycleContainer#
Type: Titanium.UI.Window, Titanium.UI.TabGroup
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.
localName#
Type: 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#
Type: String
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#
Type: Number
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#
Type: 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.
ownerDocument#
Type: Titanium.XML.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.
prefix#
Type: String
Namespace prefix of this node.
Read-only on iOS, read-write on other platforms.
PROCESSING_INSTRUCTION_NODE#
Type: Number
Used with nodeType to identify a
ProcessingInstruction node.
Methods #
addEventListener #
Adds the specified callback as an event listener for the named event.
| Name | Type | Summary | Optional |
|---|---|---|---|
name | String | Name of the event. | No |
callback | Callback<Titanium.Event> | Callback function to invoke when the event is fired. | No |
appendChild #
Appends the node newChild as a child of this node.
On iOS, appendChild is supported on Element
nodes only.
| Name | Type | Summary | Optional |
|---|---|---|---|
newChild | Titanium.XML.Node | New node to append. | No |
Returns: Titanium.XML.Node — Newly-appended node.
appendData #
Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly.
| Name | Type | Summary | Optional |
|---|---|---|---|
arg | String | The string to append. | No |
applyProperties #
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.
| Name | Type | Summary | Optional |
|---|---|---|---|
props | Dictionary | A dictionary of properties to apply. | No |
cloneNode #
Returns a duplicate of this node.
| Name | Type | Summary | Optional |
|---|---|---|---|
deep | Boolean | Whether or not to perform a deep copy of this node. | No |
Returns: Titanium.XML.Node — Cloned node.
deleteData #
Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative.
| Name | Type | Summary | Optional |
|---|---|---|---|
offset | Number | The offset from which to start removing. | No |
count | Number | The number of characters to delete. If the sum of offset and count exceeds length then all characters from offset to the end of the data are deleted. | No |
fireEvent #
Fires a synthesized event to any registered listeners.
| Name | Type | Summary | Optional |
|---|---|---|---|
name | String | Name of the event. | No |
event | Dictionary | A dictionary of keys and values to add to the Titanium.Event object sent to the listeners. | Yes |
hasAttributes #
Returns true if this node has attributes.
Returns: Boolean — True if this node has attributes, false if it does not.
hasChildNodes #
Returns true if this node has child nodes.
Returns: Boolean — True if this node has children, false if it does not.
insertBefore #
Inserts the node newChild before the node refChild.
On iOS, insertBefore is supported on Element
nodes only.
| Name | Type | Summary | Optional |
|---|---|---|---|
newChild | Titanium.XML.Node | Node to insert. | No |
refChild | Titanium.XML.Node | Node to insert newChild before. | No |
Returns: Titanium.XML.Node — The inserted node.
insertData #
Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length.
| Name | Type | Summary | Optional |
|---|---|---|---|
offset | Number | The character offset at which to insert. | No |
arg | String | The string to insert. | No |
isSupported #
Tests whether the DOM implementation supports a specific feature.
| Name | Type | Summary | Optional |
|---|---|---|---|
feature | String | Name of the feature. | No |
version | String | Version number of the feature. | No |
Returns: Boolean — True if the feature is supported, false if it is not.
normalize #
Normalizes text and attribute nodes in this node's child hierarchy.
removeChild #
Removes a child node from this node.
On iOS, removeChild is supported on Element
nodes only.
| Name | Type | Summary | Optional |
|---|---|---|---|
oldChild | Titanium.XML.Node | Node to remove. | No |
Returns: Titanium.XML.Node — Node that was removed.
removeEventListener #
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);
| Name | Type | Summary | Optional |
|---|---|---|---|
name | String | Name of the event. | No |
callback | Callback<Titanium.Event> | Callback function to remove. Must be the same function passed to addEventListener. | No |
replaceChild #
Replaces the node oldChild with the node newChild.
On iOS, replaceChild is supported on Element
nodes only.
| Name | Type | Summary | Optional |
|---|---|---|---|
newChild | Titanium.XML.Node | New node. | No |
oldChild | Titanium.XML.Node | Node being replaced. | No |
Returns: Titanium.XML.Node — Node that was replaced.
replaceData #
Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative.
| Name | Type | Summary | Optional |
|---|---|---|---|
offset | Number | The offset from which to start replacing. | No |
count | Number | The number of characters to replace. If the sum of offset and count exceeds length, then all characters to the end of the data are replaced; (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation). | No |
arg | String | The string with which the range must be replaced. | No |
splitText #
Breaks this node into two nodes at the specified by offset, and returns a new node of the same type, which contains all the content at and after the offset point. Throws an exception if the specified offset is negative or if this node is read only.
| Name | Type | Summary | Optional |
|---|---|---|---|
offset | Number | The offset at which to split, starting from 0. | No |
Returns: Titanium.XML.Text — The new node, of the same type as this node
substringData #
Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative.
| Name | Type | Summary | Optional |
|---|---|---|---|
offset | Number | Start offset of substring to extract. | No |
count | Number | The number of characters units to extract. | No |
Returns: String — The specified substring. If the sum of offset and count exceeds the length, then all 16-bit units to the end of the data are returned.