TextRef Interface

Table 2-26 summarizes the methods available through TextRef interface.

Table 2-26 Summary of NodeIterator Methods; Dom Package

Function Summary

TextRef()

Constructor.

splitText()

Split text node into two.

~TextRef()

Public default destructor.



TextRef()

Class constructor.

Syntax Description
TextRef(
   const NodeRef< Node>& node_ref,
   Node* nptr);
Used to create references to a given text node after a call to createtext.
TextRef(
   const TextRef< Node>& nref);
Copy constructor.

Parameter Description
node_ref
reference to provide the context
nptr
referenced node

Returns

(TextRef) Node reference object


splitText()

Splits a single text node into two text nodes; the original data is split between them. The offset is zero-based, and is in characters, not bytes. The original node is retained, its data is just truncated. A new text node is created which contains the remainder of the original data, and is inserted as the next sibling of the original. The new text node is returned.

Syntax

Node* splitText( 
   ub4 offset) 
throw (DOMException);
Parameter Description
offset
character offset where to split text

Returns

(Node*) new node


~TextRef()

This is the default destructor.

Syntax

~TextRef();