Changes

Jump to navigation Jump to search
721 bytes added ,  14:57, 16 January 2017
==Non-Updating Expressions==
===transformcopy/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 * More than one node can be specified as source: <pre class="brush:xquery">db:open('data')//item update delete node text()</pre> * If wrapped with curly braces, update expressions can be chained: <pre class="brush:xquery"><root/> update { insert node <child/> into .} update {Code|update} insert node "text" into child} expression is a convenience operator for writing simple transform expressions.Similar to the [[XQuery 3.0#Simple Map Operator|XQuery 3.0 map operator]], the value of the first</pre>expression is bound as context item, and the second expression performs updates on this item.The updated item is returned as result.===transform with===
Please note that The {{Code|updatetransform with}} is not part of the official XQuery Update Facility yet.It is currently being discussed in expression was added to the current [https://www.w3.org/BugsTR/Publicxquery-update-30/show_bug#id-transform-with XQuery Update 3.cgi?id0] working draft. It is a simple version of the [[#update|update]] expression and also available in BaseX: <pre class=23643 W3 Bug Tracker];"brush:xquery"><xml>text</xml> transform with {your feedback is welcome replace value of node .with 'new-text'}</pre>
==Functions==
</pre>
As shown in the example, user-defined and anonymous functions can additionally be annotated as {{Code|%updating}} (with {{Version|8.4}}, the annotation has become optional).
=Concepts=
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=
 
;Version 8.5
* Added: [[#transform with|transform with]]
* Updated: [[#update|update]] was extended.
;Version 8.0
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu