Changes

Jump to navigation Jump to search
60 bytes removed ,  14:57, 16 January 2017
==Non-Updating Expressions==
===Copy Modifycopy/modify/return===
<pre class="brush:xquery">
===update===
 
The {{Code|update}} expression is a BaseX-specific convenience operator for the {{Code|copy/modify/return}}
construct:
 
* Similar to the [[XQuery 3.0#Simple Map Operator|XQuery 3.0 map operator]], the value of the first
expression is bound as context item, and the second expression performs updates on this item.
The updated item is returned as result:
<pre class="brush:xquery">
</pre>
The {{Code|update}} expression is a BaseX-specific convenience operator for the {{Code|copy/modify/return}}construct. Similar to the [[XQuery 3.0#Simple Map Operator|XQuery 3.0 map operator]], the value of the firstexpression is bound as context item, and the second expression performs updates on this item.The updated item is returned as result. With {{Version|8.5}}, the update expression was extended: * In analogy with [[#transform with|transform with]], the updating expressions can now be – and should be – wrapped with curly braces. * More than one node can now be specified as source:
<pre class="brush:xquery">
db:open('data')//item update { delete node text() }
</pre>
* Update If wrapped with curly braces, update expressions can now be chained:
<pre class="brush:xquery">
(<root1root/>, <root2/>) update {
insert node <child/> into .
} update {
===transform with===
 
{{Mark|Introduced with Version 8.5}}:
The {{Code|transform with}} expression was added to the current [https://www.w3.org/TR/xquery-update-30/#id-transform-with XQuery Update 3.0] working draft. It is a simple version of the [[#update|update]] expression and also available in BaseX:
to the specification and BaseX. All errors are listed in the
[[XQuery Errors#Update Errors|XQuery Errors]] overview.
 
Please remember that the collected updates will be executed after the query evaluation.
If errors occur at this final stage, they cannot be caught via try/catch.
=Changelog=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu