Changes

Jump to navigation Jump to search
1 byte removed ,  12:50, 8 July 2020
no edit summary
|
* Creates a new database with an initial document and adds a document to an existing database.
<pre classsyntaxhighlight lang="brush:xquery">
declare %updating function local:update(
$database as xs:string,
local:update('new-db', 'doc.xml', db:create#2),
local:update('existing-db', 'doc.xml', db:add#2)
</presyntaxhighlight>
|}
|
* Creates two databases:
<pre classsyntaxhighlight lang="brush:xquery">
let $names := ('db1', 'db2')
return update:for-each($names, db:create#1)
</presyntaxhighlight>
|}
|
* Renames nodes in an XML snippets:
<pre classsyntaxhighlight lang="brush:xquery">
copy $xml := <xml><a/><b/></xml>
modify update:for-each-pair(
)
return $xml
</presyntaxhighlight>
|}
|
* Inserts attributes into a document:
<pre classsyntaxhighlight lang="brush:xquery">
copy $doc := <xml/>
modify update:map-for-each(
}
)
return $doc</presyntaxhighlight>
|}
==update:cache==
 
{{Mark|Updated with Version 9.3}}: {{code|$reset}} option added.
{| width='100%'
;Version 9.3
 
* [[#update:cache|update:cache]]: {{code|$reset}} parameter added.
;Version 9.1
 
* [[#update:output|update:output]]: Maps and arrays can be cached if they contain no persistent database nodes or function items.
;Version 9.0
 
* Updated: db:output renamed to {{Function|Update|update:output}}, db:output-cache renamed to {{Function|Update|update:cache}}
This module was introduced with Version 9.0.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu