saxon-help

Dear Dr. Kay,
thank you very much for your quick analysis, and also for communicating the details of the problem, rather than just announcing the fix. Also, you taught me the lesson to use subsequence() as a path step, which had never occurred to me. Just a trifling remark: the rewrite should be to
*/subsequence(*, $zz, $size)
rather than to
*/subsequence(*, $zz, ($zz + $size - 1 - $zz))
shouldn't it.
Thanks again, and kind regards -
Hans-Juergen Rennau
----- Ursprüngliche Mail ----
Thanks for reporting this. This is definitely a bug, I have logged it at
https://sourceforge.net/tracker/index.php?func=detail&aid=2086684&group_id=2
9872&atid=397617
and have committed a patch to Subversion on both the 9.0 and 9.1 branches.
What's actually happening here is that the expression is rewritten first to
let $zz := xs:integer($sampleRegion) return
*/*[let $sr := $zz
return position() = $sr to ($sr + $size - 1)]
and the next rewrite should be to
let $zz := xs:integer($sampleRegion) return
*/*[position() = $zz to ($zz + $size - 1)]
but the replacement of the variable within the integer range test isn't
working.
The expression should finally be rewritten as something like
let $zz := xs:integer($sampleRegion) return
*/subsequence(*, $zz, ($zz + $size - 1 - $zz))
which might suggest a workaround...
Michael Kay
http://www.saxonica.com/
*****************************************
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com