Database Reference
In-Depth Information
where expr1 is an XQuery expression resolving to the content sequence to insert, and
expr2 is an XQuery expression resolving to the content sequence to insert into . It
must resolve to one or more element nodes. If it contains more than one element
node, the insertion takes place for all of them.
Where to insert is determined by the keywords into , following , and preceding :
into
Appends the content in expr1 after the last child element node of expr2
following
Inserts the content in expr1 immediately after the element node expr2
preceding
Inserts the content in expr1 immediately before the element node expr2
update rename
update rename renames nodes. Its syntax is:
update rename expr1 as expr2
Here, expr1 is an XQuery expression resolving to element or attribute nodes. These
are the nodes to rename. expr2 is an XQuery expression. From the result of this
expression, the string value of the first item is used as the new name.
Note that you cannot rename document root elements using update rename . Only
nodes with a parent element node can be renamed.
update replace
update replace replaces element, attribute, or text nodes. Its syntax is:
update replace expr1 with expr2
where expr1 is an XQuery expression resolving to a single element, attribute, or text
node, and expr2 is an XQuery expression. Rules and treatment depend on the type of
expr1 :
• When expr1 is an element node, expr2 must be an element node too.
• When expr1 is an attribute or text node, the value of expr1 is replaced by the
concatenated string value of expr2 .
As an example of the second case, the following update statement replaces the value
of the name attribute on the root element of the given document with aaabbb :
update replace doc ( '/db/test/test.xml' )/ * / @name with
<a> aaa <b> bbb </b></a>
Search WWH ::




Custom Search