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 12209 - [FO][FO30] errors in definition of fn:subsequence
Summary: [FO][FO30] errors in definition of fn:subsequence
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 09:35 UTC by Mukul Gandhi
Modified: 2011-06-07 13:49 UTC (History)
0 users

See Also:


Attachments

Description Mukul Gandhi 2011-03-01 09:35:28 UTC
It seems that few parts of the text of function 'fn:subsequence' is incorrectly specified in the spec. This error seems to be present in both these documents:
1) XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition)
2) XPath and XQuery Functions and Operators 3.0 (Working Draft 14 December 2010) 

Below are possible discrepancies, and my view point of the correction, 

a)
$sourceSeq[fn:round($startingLoc) le position()]

should be,

$sourceSeq[fn:round($startingLoc) ge position()]

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

should be,

$sourceSeq[fn:round($startingLoc) ge position() 
    and position() lt fn:round($startingLoc) + fn:round($length)]

Ref:
http://www.w3.org/TR/xpath-functions/#func-subsequence (chapter 15.1.10)
http://www.w3.org/TR/xpath-functions-30/#func-subsequence (chapter 14.1.9)
Comment 1 Michael Kay 2011-03-02 11:40:21 UTC
I think the text is correct. We want to select the items whose position is at or beyond the starting location: that is position() ge $start (subject to rounding), or as the spec puts it, $start le position().
Comment 2 Mukul Gandhi 2011-03-02 16:57:56 UTC
Thanks, Mike for the explanation.

I apologize for misreading the spec and reporting this bug. I'm marking this bug report as invalid.

Thanks.
Comment 3 Michael Kay 2011-06-07 13:49:31 UTC
Closed as the originator indicated acceptance of the resolution