Replace Node Print this Topic Previous Page Up One Level Next page

Home >  User Guide and Reference > XQuery > XQuery Update Facility > Update Operations and Syntax >

Replace Node

Description and syntax

Replaces a node with a sequence of any kind of items.


replace node targetNode with items




The expression targetNode must point to a single target node.
The expression items must return a sequence of items. This sequence will replace the target node.
Except for attribute nodes, a target node can be replaced by any type of sequence.
An attribute node can only be replaced with an attribute node. See example below.




replace node //hr with '<line/>'


for $i in //@height return

replace node $i with (attribute line-height{'12pt'})


© 2019 Altova GmbH