Changes

Jump to navigation Jump to search
431 bytes added ,  17:22, 17 August 2020
|-
| '''Summary'''
|Evaluates {{Code|$input}} and returns the result {{Code|$count}} times. If Unless {{Code|$multiple}} is trueenabled, the input expression is only evaluated multiple timesonce. The function call <code>util:replicate($input, $count, true())</code> is equivalent to <code>(1 to $count) ! $input</code>.
|-
| '''Errors'''
|
* <code>util:replicate('A', 3)</code> returns <code>A A A</code>.
* In the following query, a single new element node is constructed, and {{Code|true}} is returned:
<syntaxhighlight lang="xquery">
let $nodes := util:replicate(<node/>, 2)
return $nodes[1] is $nodes[2]
</syntaxhighlight>
* In this query, two nodes are constructed, and the result is {{Code|false}}:
<syntaxhighlight lang="xquery">
let $nodes := util:replicate(<node/>, 2, true())
return $nodes[1] is $nodes[2]
</syntaxhighlight>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu