Replace a node.
A ReplaceClause
is part of an UpdateExpr
and
contains two expressions: the first one determines the update node at which the
replace operation should take place. The second expression evaluates to a node
that is used as replacement.
Replace the title
of the book
"TCP/IP Illustrated":
update replace input()/bib/book/title[. = "TCP/IP Illustrated" ] with <title>TCP/IP Illustrated I. The Protocols"</title>
Any title
element nodes that satisfy the
predicate expression will be replaced by the new
title
node.
Replace the year
attribute of the
book
with the title "TCP/IP
Illustrated":
update replace input()/bib/book[title = "TCP/IP Illustrated"]/@year with attribute year {"2003"}
The following construct(s) refer to this construct: