This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The 'end when' condition in Q2 is incorrect and leads to typing errors: end at $e when $e[self::h2] Clearly the keyword "at" should be replaced by "next" so that the window contains elements strictly between two h2: for tumbling window $w in $seq/body/* start previous $s when $s[self::h2] end next $e when $e[self::h2] return ...
I agree and adopted the current working draft accordingly.
Solution is visible in internal draft here: http://www.w3.org/XML/Group/qtspecs/use-cases/xquery-30/html/Overview.html#windowing_head_para