Changes

Jump to navigation Jump to search
68 bytes added ,  15:56, 27 February 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>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu