Skip to content

Commit

Permalink
Merge pull request qt4cg#782 from ChristianGruen/469
Browse files Browse the repository at this point in the history
469: array:of-members, map:of-pairs: Signatures, Examples
  • Loading branch information
ndw authored Oct 31, 2023
2 parents 512f37b + 88a8cb9 commit 7ddbe06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions specifications/xpath-functions-40/src/function-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19581,8 +19581,8 @@ return fold-left($MAPS, map { },
<fos:function name="of-pairs" prefix="map">
<fos:signatures>
<fos:proto name="of-pairs" return-type="map(*)">
<fos:arg name="pairs"
type="record(key as xs:anyAtomicType, value as item()*, *)*"
<fos:arg name="input"
type="record(key as xs:anyAtomicType, value as item()*)*"
usage="inspection"
example="map{'key':'n','value':false()},map{'key':'y','value':true()}"/>
<fos:arg name="combine" type="function(item()*, item()*) as item()*" usage="inspection" default="fn:op(',')"/>
Expand All @@ -19602,15 +19602,15 @@ return fold-left($MAPS, map { },
<p>The function <code>map:of-pairs</code>
<phrase>returns a map</phrase> that
is formed by combining <termref def="dt-key-value-pair-map">key-value pair maps</termref> supplied in the
<code>$key-value-pairs</code>
<code>$input</code>
argument.</p>

<p>The optional <code>$combine</code> argument can be used to define how
duplicate keys should be handled. The default is to form the sequence concatenation
of the corresponding values, retaining their order in the input sequence.</p>

<p>The effect of the function is equivalent to the expression:</p>
<eg>map:build($key-value-pairs, fn($kvp) { $kvp?key }, fn($kvp) { $kvp?value }, $combine)</eg>
<eg>map:pairs($week) => map:build(fn { ?key }, fn { ?value }, $combine)</eg>


</fos:rules>
Expand Down

0 comments on commit 7ddbe06

Please sign in to comment.