| Splites the text node into two adjacent text nodes, based on the index specified. |
Signature: splitText($offset) |
Parameters:
int offset - The point at which to split the text.
|
Returns:
DOMIT_TextNode - The new DOMIT_TextNode.
|
Example:
The text will be split into two text nodes at its 4th character: $myTextNode =& $aTextNode->splitText(4);); |
| Returns the node value of the text node |
Signature: getText() |
| Sets the nodeValue to the contents of $data. |
Signature: setText($data) |
Parameters:
string data - The text data of the node.
|
Example:
The data added as the nodeValue of the text node. $someTextNode->setText('This is some data'); |
| Returns a copy of the specified node, and if $deep is set to true, all nodes below it in the hierarchy. |
Signature: &cloneNode($deep) |
Parameters:
boolean deep - True if the children below the cloned node are also to be cloned.
|
Returns:
DOMIT_Node - The cloned node, with a clone of all subnodes if $deep is set to true.
|
Example:
In the following example, a node named $styleTemplate is cloned, presumably so the user can create a new style based on the characteristics of the original node. $newStyle =& styleTemplate->cloneNode(false); |
| Generates an unformatted (single line, no whitespace) string representation of the text node and all children. |
Signature: toString($htmlSafe = false, $subEntities = false) |
Parameters:
boolean htmlSafe - If true, returns an html formatted representation of the string.
boolean subEntities - True if illegal xml characters should be converted to entities.
|
Returns:
String - An unformatted (single line, no whitespace) string representation of the text node and all children.
|
Example:
An unformatted string representation of the text node will be printed here: echo ($myTextNode->toString(true); |