This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4310 - fn-subsequence-mix-args-009, 011, 022 not aligned with latest spec
Summary: fn-subsequence-mix-args-009, 011, 022 not aligned with latest spec
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.2
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-08 18:27 UTC by Frans Englich
Modified: 2007-02-09 13:44 UTC (History)
0 users

See Also:


Attachments

Description Frans Englich 2007-02-08 18:27:53 UTC
I'm questioning the baselines of:

    fn-subsequence-mix-args-009
    fn-subsequence-mix-args-011
    fn-subsequence-mix-args-022

For instance, 009's query is:

fn:subsequence( ("a", xs:float("INF"), "b", "c"),-2,3) 

and expects the empty sequence as output.

Contrasting the arguments to 15.1.10 fn:subsequence: "If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq." Since startingLoc is -2, we begin from the very beginning of the sequence.

Therefore, I conclude that the return sequence should be: a INF b.

I (hopefully correctly) remember that fn:subsequence were described with a rather complex algorithm that involved arithmetics between the length/position arguments, and apparently subsequence have changed here(although I don't recall when). Maybe the tests should be aligned with the latest spec?

If one reads the summary in isolation, "Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length." the baseline makes more sense, but in my opinion the Notes is rather clear.


Frans
Comment 1 Michael Kay 2007-02-08 19:09:38 UTC
The definitive statement is this:

In the three-argument case, returns:

$sourceSeq[fn:round($startingLoc) le $p 
     and $p lt fn:round($startingLoc) + fn:round($length)]

Which means that you get items -2, -1, and 0 from the sequence - i.e. nothing.

The Notes are non-normative.
Comment 2 Frans Englich 2007-02-09 13:43:35 UTC
Let's just forget this report.