Changes

Jump to navigation Jump to search
84 bytes removed ,  18:33, 1 December 2023
m
Text replacement - "<syntaxhighlight lang="xquery">" to "<pre lang='xquery'>"
* {{Code|xquery:eval("1+3")}} returns {{Code|4}}.<br/>
* If a URI is supplied, the query in the specified file will be evaluated:
<syntaxhighlight pre lang="'xquery"'>
xquery:eval(xs:anyURI('cleanup.xq'))
</pre>
* You can bind the context and e.g. operate on a certain database only:<br/>
<syntaxhighlight pre lang="'xquery"'>
xquery:eval("//country", map { '': db:get('factbook') })
</pre>
* The following expressions use strings as keys. All of them return 'XML':<br/>
<syntaxhighlight pre lang="'xquery"'>
xquery:eval(".", map { '': 'XML' }),
</pre>
* The following expressions use QNames as keys. All of them return 'XML':<br/>
<syntaxhighlight pre lang="'xquery"'>
declare namespace pref = 'URI';
|
* Removes entries from a temporary databases and returns an info string:
<syntaxhighlight pre lang="'xquery"'>
xquery:eval-update("
delete node db:get('tmp')/*,
|
* Request 100 URLs, use at most 8 parallel threads:
<syntaxhighlight pre lang="'xquery"'>
xquery:fork-join(
for $segment in 1 to 100
</pre>
* Parallel sleep function calls. The function is expected to finish in 1 second if the system has at least 2 cores:
<syntaxhighlight pre lang="'xquery"'>
let $f := function() { prof:sleep(1000) }
return xquery:fork-join(($f, $f))
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu