Changes

Jump to navigation Jump to search
508 bytes added ,  02:45, 19 December 2014
fn:parse-ietf-date('28-Feb-1984 07:07:07')" (: yields 1984-02-28T07:07:07Z :),
fn:parse-ietf-date('Wed, 01 Jun 2001 23:45:54 +02:00')" (: yields 2001-06-01T23:45:54+02:00 :)
</pre>
 
===fn:apply===
 
; Signatures
* <code>fn:apply($function as function(*), $array as array(*)) as item()*</code>
 
A supplied function is invoked with the arguments supplied by an array. The arity of the function must be the same as the size of the array.
 
Example:
 
<pre class="brush:xquery">
fn:apply(concat#5, array { 1 to 5 }) (: 12345 :)
fn:apply(function($a) { sum($a) }, [ 1 to 5 ]) (: 15 :)
fn:apply(count#1, [ 1,2 ]) (: error (the array has two members) :)
</pre>
* <code>fn:random-number-generator($seed as xs:anyAtomicType) as map(xs:string, item())</code>
Creates a random number generator, using an optional seed. The returned map contains three entries:
* {{Code|number}} is a random double between 0 and 1
* {{Code|permute}} is a function that returns a random permutation of its argument
The returned random generator is ''determnisticdeterministic'': If the function is called twice with the same arguments and in the same execution scope, it will always return the same result.
Example:
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu