Changes

Jump to navigation Jump to search
630 bytes added ,  18:50, 18 November 2020
==util:ddo==
 
{{Mark|Introduced with Version 9.3:}}
{| width='100%'
|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%'
==util:replicate==
 
{{Mark|Updated with Version 9.5:}} Third argument added.
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|util:replicate|$sequence input as item()*, $count as xs:integer|item()*}}<br/>{{Func|util:replicate|$input as item()*, $count as xs:integer, $multiple as xs:boolean|item()*}}
|-
| '''Summary'''
|Returns Evaluates {{Code|$input}} and returns the result {{Code|$count}} instances of the specified times. Unless {{Code|$sequencemultiple}}is enabled, the input expression is only evaluated once. A similar result can be generated with The function call <code>util:replicate($input, $count, true())</code> is equivalent to <code>(1 to $count) ! $sequenceinput</code>, but in the latter case, the right-hand expression will be evaluated multiple times.
|-
| '''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>
|}
=Changelog=
 
;Version 9.5
* Updated: [[#util:replicate|util:replicate]]: Third argument added.
;Version 9.4
;Version 9.2
* Added: [[#util:chars|util:chars]], [[#util:init|util:init]]
* UpdatesUpdated: [[#util:item|util:item]], [[#util:last|util:last]], [[#util:range|util:range]] renamed (before: {{Code|util:item-at}}, {{Code|util:item-range}}, {{Code|util:last-from}})
;Version 9.1
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu