Update Module

From BaseX Documentation

(Difference between revisions)
Jump to: navigation, search
(update:output)
Line 1: Line 1:
-
This [[Module Library|XQuery Module]] adds updating functions.
+
This [[Module Library|XQuery Module]] provides additional functions for performing updates and returning results in [[XQuery Update|updating expressions]].
=Conventions=
=Conventions=
All functions in this module are assigned to the <code><nowiki>http://basex.org/modules/update</nowiki></code> namespace, which is statically bound to the {{Code|update}} prefix.<br/>
All functions in this module are assigned to the <code><nowiki>http://basex.org/modules/update</nowiki></code> namespace, which is statically bound to the {{Code|update}} prefix.<br/>
 +
 +
Except for [[#update:output-cache|update:output-cache]], all functions are **updating** and thus comply to the XQuery Update constraints.
=Output=
=Output=

Revision as of 09:56, 12 December 2017

This XQuery Module provides additional functions for performing updates and returning results in updating expressions.

Contents

Conventions

All functions in this module are assigned to the http://basex.org/modules/update namespace, which is statically bound to the update prefix.

Except for update:output-cache, all functions are **updating** and thus comply to the XQuery Update constraints.

Output

update:output

Updated with Version 9.0: formerly db:output.

Signatures update:output($result as item()*) as empty-sequence()
Summary This function is a helper function for returning results in an updating expression. The argument of the function will be evaluated, and the resulting items will be cached and returned after the updates on the pending update list have been processed. As nodes may be updated, they will be copied before being cached.
Examples
  • update:output("Prices have been deleted."), delete node //price deletes all price elements in a database and returns an info message.

update:output-cache

Updated with Version 9.0: formerly db:output-cache.

Signatures update:output-cache() as item()*
Summary Returns the items that have been cached by update:output. It can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests.

Changelog

This module was introduced with Version 9.0.

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export