Package | dom.core |
Class | public class CharacterData |
Inheritance | CharacterData Node Object |
Subclasses | Comment, Text |
Introduced in: | DOM 1 Core |
See also
Property | Defined By | ||
---|---|---|---|
DOM 1 Core attributes : NamedNodeMap [read-only]
Returns an unordered collection of Attr nodes. | Node | ||
Non-Standard baseName : DOMString [read-only]
Returns the base name for the name qualified with the namespace. | Node | ||
DOM 3 Core baseURI : DOMString [read-only]
The absolute base URI of this node or null if the implementation
wasn't able to obtain an absolute URI. | Node | ||
DOM 1 Core childNodes : NodeList [read-only]
Returns an ordered collection of node objects that are children of
the current element. | Node | ||
DOM 1 Core data : DOMString
The character data of the node that implements this interface. | CharacterData | ||
Non-Standard dataType : *
Specifies the data type for this node. | Node | ||
Non-Standard definition : Node [read-only]
Returns the definition of the node in the document type definition (DTD) or schema. | Node | ||
DOM 1 Core firstChild : Node [read-only]
Returns the node's first child in the tree, or null if the node is
childless. | Node | ||
DOM 1 Core lastChild : Node [read-only]
Returns the last child of a node. | Node | ||
DOM 1 Core length : Number [read-only]
The number of 16-bit units that are available through data and the
substringData method below. | CharacterData | ||
DOM 2 Core localName : DOMString [read-only]
Returns the local part of the qualified name of this node. | Node | ||
DOM 2 Core namespaceURI : DOMString [read-only]
The namespace URI of the node, or null if it is unspecified (read-only). | Node | ||
DOM 1 Core nextSibling : Node [read-only]
Returns the node immediately following the specified one in its
parent's childNodes list, or null if the specified node is the
last node in that list. | Node | ||
DOM 1 Core nodeName : DOMString [read-only]
Returns the name of the current node as a string. | Node | ||
Non-Standard nodePrincipal : nsIPrincipal [read-only]
Returns the nsIPrincipal object representing current security
context of the node. | Node | ||
DOM 1 Core nodeType : Number [read-only]
Returns an integer code representing the type of the node. | Node | ||
Non-Standard nodeTypedValue : *
Contains the node value expressed in its defined data type. | Node | ||
Non-Standard nodeTypeString : DOMString [read-only]
Returns the node type in string form. | Node | ||
DOM 1 Core nodeValue : DOMString
Returns or sets the value of the current node. | Node | ||
DOM 1 Core ownerDocument : Document [read-only]
The Document object associated with this node. | Node | ||
DOM 1 Core parentNode : Node [read-only]
Returns the parent of the specified node in the DOM tree. | Node | ||
Non-Standard parsed : Boolean [read-only]
Indicates the parsed status of the node and child nodes. | Node | ||
DOM 2 Core prefix : DOMString
Returns the namespace prefix of the specified node, or null if no
prefix is specified. | Node | ||
DOM 1 Core previousSibling : Node [read-only]
Returns the node immediately preceding the specified one in its
parent's childNodes list, null if the specified node is the first
in that list. | Node | ||
Non-Standard specified : Boolean [read-only]
Indicates whether the node (usually an attribute) is explicitly specified or derived
from a default value in the document type definition (DTD) or schema. | Node | ||
Non-Standard text : DOMString
Represents the text content of the node or the concatenated text representing the node and its descendants. | Node | ||
DOM 3 Core textContent : DOMString
Gets or sets the text content of a node and its descendants. | Node | ||
Non-Standard xml : DOMString [read-only]
Contains the XML representation of the node and all its descendants. | Node |
Method | Defined By | ||
---|---|---|---|
Associates a function with a particular event and binds the event to the current node. | Node | ||
DOM 3 Events addEventListenerNS(namespaceURI:DOMString, type:DOMString, listener:EventListener, useCapture:Boolean):void
Registers an event listener, depending on the useCapture parameter, on the
capture phase of the DOM event flow or its target and bubbling phases. | Node | ||
Adds a node to the end of the list of children of a specified parent node. | Node | ||
Append the string to the end of the character data of the node. | CharacterData | ||
Returns a duplicate of the current node. | Node | ||
Compares the position of the current node against another node in any other document. | Node | ||
DOM 1 Core deleteData(offset:Number, count:Number):void
Remove a range of 16-bit units from the node. | CharacterData | ||
Dispatches an event to fire on a node artificially. | Node | ||
This method returns a specialized object which implements the
specialized APIs of the specified feature and version, as specified
in DOM Features. | Node | ||
Retrieves the object associated to a key on a this node. | Node | ||
DOM 2 Core hasAttributes():Boolean
Returns a boolean value of true or false, indicating if the current element
has any attributes or not. | Node | ||
DOM 1 Core hasChildNodes():Boolean
Returns a value that indicates whether the object has children. | Node | ||
Inserts the specified node before a reference element as a child of
the current node. | Node | ||
Insert a string at the specified 16-bit unit offset. | CharacterData | ||
Returns true if the namespace is the default namespace on the given
node or false if not. | Node | ||
Tests whether two nodes are equal. | Node | ||
Returns whether this node is the same node as the given one. | Node | ||
Tests whether the DOM implementation implements a specific feature
and that feature is supported by this node. | Node | ||
Takes a prefix and returns the namespaceURI associated with it on the
given node if found (and null if not). | Node | ||
Returns the prefix for a given namespaceURI if present, and null if not. | Node | ||
DOM 1 Core normalize():void
Puts the specified node and all of its subtree into a "normalized"
form. | Node | ||
Removes a child node from the object. | Node | ||
Removes an event listener. | Node | ||
DOM 3 Events removeEventListenerNS(namespaceURI:DOMString, type:DOMString, listener:EventListener, useCapture:Boolean):void
Removes an event listener. | Node | ||
Replaces an existing child element with a new child element. | Node | ||
Replace the characters starting at the specified 16-bit unit offset
with the specified string. | CharacterData | ||
Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as IXMLDOMNodeList. | Node | ||
Applies the specified pattern-matching operation to this node's context and returns the first matching node. | Node | ||
Associate an object to a key on this node. | Node | ||
Extracts a range of data from the node. | CharacterData | ||
Processes this node and its children using the supplied Extensible Stylesheet Language Transformations
(XSLT) style sheet and returns the resulting transformation. | Node | ||
Processes this node and its children using the supplied Extensible Stylesheet Language Transformations (XSLT) style sheet
and returns the resulting transformation. | Node |
Event | Summary | Defined By | ||
---|---|---|---|---|
Occurs after CharacterData.data or ProcessingInstruction.data have been modified but the node itself has not been inserted or deleted. | CharacterData | |||
A node has been added as a child of another node or, in case of Attr nodes, has been added to an Element. | CharacterData | |||
A node has been inserted into a document, either through direct insertion of the node or insertion of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. | CharacterData | |||
A node is being removed from its parent node or, in case of Attr nodes, removed from its ownerElement. | CharacterData | |||
A node is being removed from a document, either through direct removal of the node or removal of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. | CharacterData |
DOM 1 Core data | property |
data:DOMString
Introduced in: | DOM 1 Core |
The character data of the node that implements this interface.
The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.
public function get data():DOMString
public function set data(value:DOMString):void
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised when
the node is readonly.
| |
DOMException — DOMSTRING_SIZE_ERR: Raised when it would
return more characters than fit in a DOMString variable on the
implementation platform.
|
See also
DOM 1 Core length | property |
length:Number
[read-only] Introduced in: | DOM 1 Core |
The number of 16-bit units that are available through data and the substringData method below. This may have the value zero, i.e., CharacterData nodes may be empty.
public function get length():Number
See also
DOM 1 Core appendData | () | method |
public function appendData(arg:DOMString):void
Introduced in: | DOM 1 Core |
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 DOMString specified.
Parameters
arg:DOMString — The DOMString to append.
|
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
|
See also
DOM 1 Core deleteData | () | method |
public function deleteData(offset:Number, count:Number):void
Introduced in: | DOM 1 Core |
Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.
Parameters
offset:Number — The offset from which to start removing.
| |
count:Number — The number of 16-bit units to delete. If the sum of offset
and count exceeds length then all 16-bit units from offset to the end of
the data are deleted.
|
DOMException — INDEX_SIZE_ERR: Raised if the specified
offset is negative or greater than the number of 16-bit units in data,
or if the specified count is negative.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
|
See also
DOM 1 Core insertData | () | method |
public function insertData(offset:Number, arg:DOMString):void
Introduced in: | DOM 1 Core |
Insert a string at the specified 16-bit unit offset.
Parameters
offset:Number — The character offset at which to insert.
| |
arg:DOMString — The DOMString to insert.
|
DOMException — INDEX_SIZE_ERR: Raised if the specified
offset is negative or greater than the number of 16-bit units in data.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
|
See also
DOM 1 Core replaceData | () | method |
public function replaceData(offset:Number, count:Number, arg:DOMString):void
Introduced in: | DOM 1 Core |
Replace the characters starting at the specified 16-bit unit offset with the specified string.
Parameters
offset:Number — The offset from which to start replacing.
| |
count:Number — The number of 16-bit units to replace. If the sum of
offset and count exceeds length, then all 16-bit units 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).
| |
arg:DOMString — The DOMString with which the range must be replaced.
|
DOMException — INDEX_SIZE_ERR: Raised if the specified
offset is negative or greater than the number of 16-bit units in data,
or if the specified count is negative.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
|
See also
DOM 1 Core substringData | () | method |
public function substringData(offset:Number, count:Number):DOMString
Introduced in: | DOM 1 Core |
Extracts a range of data from the node.
Parameters
offset:Number — Start offset of substring to extract.
| |
count:Number — The number of 16-bit units to extract.
|
DOMString — 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.
|
DOMException — INDEX_SIZE_ERR: Raised if the specified
offset is negative or greater than the number of 16-bit units in data,
or if the specified count is negative.
| |
DOMException — DOMSTRING_SIZE_ERR: Raised if the specified
range of text does not fit into a DOMString.
|
See also
DOMCharacterDataModified | Event |
dom.events.MutationEvent
DOMCharacterDataModified
Occurs after CharacterData.data or ProcessingInstruction.data have been modified but the node itself has not been inserted or deleted. The target node of this event is the CharacterData node or the ProcessingInstruction node.
DOMNodeInserted | Event |
dom.events.MutationEvent
DOMNodeInserted
A node has been added as a child of another node or, in case of Attr nodes, has been added to an Element. This event is dispatched after the insertion has taken place. The target node of this event is the node being inserted.
DOMNodeInsertedIntoDocument | Event |
dom.events.MutationEvent
DOMNodeInsertedIntoDocument
A node has been inserted into a document, either through direct insertion of the node or insertion of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. This event is dispatched after the insertion has taken place. The target node of this event is the node being inserted. If the node is being directly inserted, the event type DOMNodeInserted occurs before this event type.
DOMNodeRemoved | Event |
dom.events.MutationEvent
DOMNodeRemoved
A node is being removed from its parent node or, in case of Attr nodes, removed from its ownerElement. This event is dispatched before the removal takes place. The target node of this event is the node being removed.
DOMNodeRemovedFromDocument | Event |
dom.events.MutationEvent
DOMNodeRemovedFromDocument
A node is being removed from a document, either through direct removal of the node or removal of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. This event is dispatched before the removal takes place. The target node of this event type is the node being removed. If the node is being directly removed, the event type DOMNodeRemoved occurs before this event type.