Skip to content

Commit

Permalink
Copy editing
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhkay committed Dec 11, 2024
1 parent e3c87ad commit a0e2655
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
21 changes: 10 additions & 11 deletions specifications/xquery-40/src/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19136,7 +19136,7 @@ processing with JSON processing.</p>
see <xspecref spec="FO40" ref="maps"/>.</p>

<note>
<p>Maps in &language; have a property called <xspecref spec="DM40" ref="dt-map-ordered"/>,
<p>Maps in &language; have a property called <xtermref spec="DM40" ref="dt-map-ordered"/>,
which takes the value <code>true</code> or <code>false</code>; a map
is accordingly said to be <term>ordered</term> or <term>unordered</term>.
The effect of this property is explained
Expand Down Expand Up @@ -19874,9 +19874,8 @@ processing with JSON processing.</p>
<note>
<p>The order of entries in the result sequence in this case
reflects the <xtermref spec="DM40" ref="dt-entry-order">entry order</xtermref>
of the map. In the default case where the <code>ordering</code> of the
map is <code>undefined</code>, the order of entries in the result sequence
is implementation-dependent.</p>
of the map. In the default case where the map is unordered,
the order of entries in the result sequence is implementation-dependent.</p>
</note>
</item>
<!--<item>
Expand Down Expand Up @@ -20502,10 +20501,9 @@ return $array?[count(.) ge 2]</eg>
and the context size is the number of entries in the map. The result
of the expression is a map containing those entries of the input map for which
the <termref def="dt-predicate-truth-value"/> of the <code><var>FILTER</var></code> expression is true.
The <code>ordering</code> property of the result is the same as the <code>ordering</code>
property of the input map, and in the case of <code>sorted</code> or <code>insertion</code>
ordering the relative order of entries in the result retains the relative order of entries
in the input.
The <code>ordered</code> property of the result is the same as the <code>ordered</code>
property of the input map, and in the case of an ordered map, the relative order of
entries in the result retains the relative order of entries in the input.
</p>

<p>For example, the following expression:</p>
Expand All @@ -20519,9 +20517,10 @@ return $map?[?key ge 2]</eg>

<note>
<p>Filtering of maps based on numeric positions is not generally useful when
the <code>ordering</code> of the map is <code>undefined</code>,
because the order of entries in a map is unpredictable; but it is available
in the interests of orthogonality. </p>
the map is unordered, because the order of entries is unpredictable; but it is available
in the interests of orthogonality.</p>
<p>With an ordered map, a filter expression such as <code>$map?[last()-1, last()]</code>
might be used to return the last two entries.</p>
</note>
</div3>

Expand Down
8 changes: 4 additions & 4 deletions specifications/xquery-40/src/query-prolog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,7 @@ local:depth(doc("partlist.xml"))
map:merge((
{ "r": $r },
{ "i": $i }
), { "ordering" : "insertion" })
), { "retain-order" : true() })
};
</eg>

Expand Down Expand Up @@ -2163,7 +2163,7 @@ local:depth(doc("partlist.xml"))
map:merge((
{ "r": $r },
if (exists($i)) { { "i": $i } }
), { "ordering" : "insertion" })
), { "retain-order" : true() })
};
</eg>

Expand Down Expand Up @@ -2192,7 +2192,7 @@ local:depth(doc("partlist.xml"))
{ "last": $last },
$options
),
{ "duplicates": "use-first", "ordering" : "insertion" }
{ "duplicates": "use-first", "retain-order" : true() }
};
</eg>

Expand Down Expand Up @@ -2251,7 +2251,7 @@ local:depth(doc("partlist.xml"))
<item><p>The optional final subexpression, if present, takes the form <code>$options</code>,
where <code>$options</code> is the name allocated to the final parameter.</p></item>
<item><p>The second argument in the call of the function <code>map:merge</code>
is the map <code>{ "duplicates": "use-first", "ordering": "insertion" }</code>.</p></item>
is the map <code>{ "duplicates": "use-first", "retain-order": true() }</code>.</p></item>
</ulist>
</item>

Expand Down

0 comments on commit a0e2655

Please sign in to comment.