Changes

Jump to navigation Jump to search
514 bytes added ,  11:43, 6 October 2017
no edit summary
==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">
return $item update delete node text()
</pre>
 
The {{Code|update}} expression is a 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.
 
With {{Version|8.5}}, the update expression was extended:
* More than one node can be specified as source:
</pre>
* In analogy with [[#transform with|transform with]], the updating expressions can – and should – be If wrapped with curly braces. * Update , update expressions can now be chained:
<pre class="brush:xquery">
(<root1root/>, <root2/>) update {
insert node <child/> into .
} update {
===transform with===
The {{MarkCode|Introduced transform with Version 8.5}}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 availablein BaseX:
The {{Code|<pre class="brush:xquery"><xml>text</xml> transform with}} expression is part { replace value of the [https://wwwnode .w3.org/TR/xquerywith 'new-update-30text'}</#id-transform-with XQuery Update 3.0] working draft. It is also available in BaseX.pre>
==Functions==
===Built-in Functions===
{{Code|fn:put()}} is can be used to serialize XDM instances to secondary storage. It is executed at the end of a snapshot. Serialized documents therefore reflect all changes made effective during a query. No files will be created if the addressed nodes have been deleted. With {{Version|9.0}}, serialization parameters can be specified as third argument (more details are found in the [https://www.w3.org/TR/xquery-update-30/#id-func-put XQUF 3.0 Specification]).
Additional Numerous additional [[Database Module#Updates|database functions]] exist for performing updates on document and database level.
===User-Defined Functions===
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 9.0
* Updated: [[#Built-in Functions|Built-in Functions]]: serialization parameters
;Version 8.5
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu