Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 294: fn:remove() #313

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 27 additions & 8 deletions specifications/xpath-functions-40/src/function-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5268,6 +5268,9 @@ Tak, tak, tak! - da kommen sie.
</fos:test>
</fos:example>
</fos:examples>
<fos:history>
<fos:version version="4.0">Proposed change for 4.0: allow second argument to be an empty sequence.</fos:version>
</fos:history>
</fos:function>
<fos:function name="analyze-string" prefix="fn">
<fos:signatures>
Expand Down Expand Up @@ -11133,7 +11136,7 @@ let $newi := $o/tool</eg>
<fos:signatures>
<fos:proto name="remove" return-type="item()*">
<fos:arg name="input" type="item()*" usage="transmission"/>
<fos:arg name="position" type="xs:integer"/>
<fos:arg name="positions" type="xs:integer*"/>
</fos:proto>
</fos:signatures>
<fos:properties>
Expand All @@ -11142,18 +11145,19 @@ let $newi := $o/tool</eg>
<fos:property>focus-independent</fos:property>
</fos:properties>
<fos:summary>
<p>Returns a new sequence containing all the items of <code>$input</code> except the item
at position <code>$position</code>.</p>
<p>Returns a new sequence containing all the items of <code>$input</code> <phrase diff="chg" at="2023-01-17">except those
at specified positions</phrase>.</p>
</fos:summary>
<fos:rules>
<p>The function returns a sequence consisting of all items of <code>$input</code> whose
1-based position is less than <code>$position</code>, followed by all items of <code>$target</code>
whose 1-based position is greater than <code>$position</code>. </p>
<p>The function returns a sequence consisting of all items of <code>$input</code> <phrase diff="chg" at="2023-01-17">whose
1-based position is not equal to any of the integers in <code>$positions</code>. </phrase></p>
<p diff="add" at="2023-01-17">More formally, the function returns the result of the expression <code>$input[not(position() = $positions)]</code>.</p>
</fos:rules>
<fos:notes>
<p>If <code>$position</code> is less than 1 or greater than the number of items in
<code>$input</code>, <code>$input</code> is returned.</p>
<p diff="chg" at="2023-01-17">Any integer in <code>$positions</code> that is less than 1 or greater than the number of items in
<code>$input</code> is effectively ignored.</p>
<p>If <code>$input</code> is the empty sequence, the empty sequence is returned.</p>
<p diff="add" at="2023-01-17">If <code>$positions</code> is an empty sequence, the input sequence <code>$input</code> is returned unchanged.</p>
</fos:notes>
<fos:examples>
<fos:variable id="v-remove-abc" name="abc"
Expand Down Expand Up @@ -11182,7 +11186,22 @@ let $newi := $o/tool</eg>
<fos:result>()</fos:result>
</fos:test>
</fos:example>
<fos:example>
<fos:test use="v-remove-abc">
<fos:expression>fn:remove($abc, 2 to 3)</fos:expression>
<fos:result>"a"</fos:result>
</fos:test>
</fos:example>
<fos:example>
<fos:test use="v-remove-abc">
<fos:expression>fn:remove($abc, ())</fos:expression>
<fos:result>("a", "b", "c")</fos:result>
</fos:test>
</fos:example>
</fos:examples>
<fos:history>
<fos:version version="4.0">Proposed change for 4.0: allow second argument to be a sequence of integers.</fos:version>
</fos:history>
</fos:function>
<fos:function name="head" prefix="fn">
<fos:signatures>
Expand Down