Changes

Jump to navigation Jump to search
392 bytes added ,  18:50, 18 November 2020
|Returns nodes in ''distinct document order'': duplicate nodes will be removed, and the remaining nodes will be returned in [https://www.w3.org/TR/xquery-31/#dt-document-order document order]. All results of path expression are in distinct document order, so the function is equivalent to the expression <code>$nodes/self::node()</code>.
|}
 
{{Mark|Introduced with Version 9.4:}}
{| width='100%'
|-
| '''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