Create a text node from a string.
The following construct(s) refer to this construct:
tf:createTextNode(string $string) => textNode
The function tf:createTextNode
is specific to Tamino. It
takes a string as argument and creates a text node containing the value of the
string.
Note:
This function is deprecated and will be removed in future versions of
Tamino. You should use CompTextConstructor
instead. See the examples for details.
$string |
string value |
---|
Replace a book title directly on the text node:
update replace input()/bib/book/title[. = "TCP/IP Illustrated" ]/text() with tf:createTextNode("TCP/IP Illustrated I. The Protocols")
The text node of the title
element with the
content "TCP/IP Illustrated" is replaced with a text
node created by tf:createTextNode
that has the contents
"TCP/IP Illustrated I. The Protocols". Instead of
this deprecated function you could use a computed text node constructor:
update replace input()/bib/book/title[. = "TCP/IP Illustrated" ]/text() with text { "TCP/IP Illustrated I. The Protocols" }
Alternatively you could also write this query as follows:
update replace input()/bib/book/title[. = "TCP/IP Illustrated" ]/text() with <title>TCP/IP Illustrated I. The Protocols</title>/text()