[Bug 1523] New: [FO] fn:subsequence and negative start position

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1523

           Summary: [FO] fn:subsequence and negative start position
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: ashok.malhotra@oracle.com
        ReportedBy: abehm@ca.ibm.com
         QAContact: public-qt-comments@w3.org


The XTTF does not agree on the result of the following query:

fn:subsequence((1,2,3,4), -2, 4)

The result is determined by the following two statements:

"returns the items in $sourceString whose position $p obeys:
fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)"

which means -2 <= $p < 2

"If $startingLoc is zero or negative, the subsequence includes items from
the beginning of the $sourceSeq."

but it is not clear in which order the rules are applied to identify
valid positions. We found two possible interpretations:

1. apply the second rule first and define the valid positions as
1 <= $p < 5 such that the result is "1 2 3 4", or
2. define the valid positions first as -2 <= $p < 2 and start with position 1,
such that the result is "1".

We have not reached agreement in the XQuery Test Task Force and ask the
Working Group for clarification.

On behalf of XTTF
Andreas Behm

Received on Thursday, 7 July 2005 20:28:36 UTC