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

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





------- Additional Comments From mike@saxonica.com  2005-07-10 22:23 -------
On rereading this text, it occurs to me that there's nothing in the either the
old or the new version that states unequivocally that the order of items in the
result is the same as the order in the input (which I believe is true even in
unordered mode). This can be fixed by changing the rules to:

RULES

In the two-argument case, returns 

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

In the three-argument case, returns 

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

Since we get many questions about it, it might also be worth adding a

NOTE

The reason the function accepts arguments of type xs:double is that many
computations on untyped data return an xs:double result; and the reason for the
rounding rules is to compensate for any imprecision in these floating-point
computations.

Received on Sunday, 10 July 2005 22:23:54 UTC