|
|
Text inherits from Node.
Text
|
nodeName |
Returns '#text'
|
nodeType |
Returns TEXT_NODE
|
nodeValue |
Returns the text data.
|
data |
Returns the text data.
|
length |
Returns the length of the text.
|
substringData(offset, count) |
Returns a count character substring starting at
offset
|
appendData(data) |
Appends data to the text. |
insertData(offset, data) |
Inserts data to the text. |
deleteData(offset, count) |
Deletes a range of data from the text. |
replaceData(offset, count, data) |
Replaces the range with new data. |
splitText(offset) |
Splits the text into two sibling nodes, returning the second. |
Returns '#text'
Returns TEXT_NODE
Returns the text data.
Returns the text data.
Returns the length of the text.
substringData(offset, count)
|
Returns a count character substring starting at
offset
xml = caucho.xml.Xml.parseString('<a>123456</a>');
elt = xml.documentElement
text = elt.firstChild
writeln(text.substringData(2, 3))
|
345
|
Appends data to the text.
xml = caucho.xml.Xml.parseString('<a>123456</a>');
elt = xml.documentElement
text = elt.firstChild
text.appendData("freezow");
writeln(text);
|
123456freezow
|
Inserts data to the text.
xml = caucho.xml.Xml.parseString('<a>123456</a>');
elt = xml.documentElement
text = elt.firstChild
text.insertData(1, "freezow");
writeln(text);
|
1freezow23456
|
deleteData(offset, count)
|
Deletes a range of data from the text.
xml = caucho.xml.Xml.parseString('<a>123456</a>');
elt = xml.documentElement
text = elt.firstChild
text.deleteData(1, 2, "new");
writeln(text);
|
1456
|
replaceData(offset, count, data)
|
Replaces the range with new data.
xml = caucho.xml.Xml.parseString('<a>123456</a>');
elt = xml.documentElement
text = elt.firstChild
text.replaceData(1, 2, "new");
writeln(text);
|
1new456
|
Splits the text into two sibling nodes, returning the second.
xml = caucho.xml.Xml.parseString('<a>1234</a>');
elt = xml.documentElement
text = elt.firstChild
newText = text.splitText(2);
newText.insertData(0, "foo")
writeln(newText.data)
xml.print(out)
|
foo34
<a>12foo34</a>
|
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:57:59 -0800 (PST)
|