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

Normally the rules are interpreted in order as they appear in the
document. So this should return "1".

Best regards
Michael

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of bugzilla@wiggum.w3.org
> Sent: Thursday, July 07, 2005 1:29 PM
> To: public-qt-comments@w3.org
> Subject: [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:33:21 UTC