This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the current working draft of XQuery F&O 3.0, the fn:for-each() function ( http://www.w3.org/TR/xpath-functions-30/#func-for-each ) has the following equivalent XQuery code: declare function fn:for-each($seq, $f) { if (fn:empty($seq)) then () else $f(fn:head($seq)), fn:for-each(fn:tail($seq), $f) }; Probably the parenthesis around the else branch have been omitted, and so this code will result in an infinite recursion for any input. The fix would be to change the line: else $f(fn:head($seq)), fn:for-each(fn:tail($seq), $f) to: else ($f(fn:head($seq)), fn:for-each(fn:tail($seq), $f))
Thanks, I have deemed this editorial and have fixed it (by adding parentheses as suggested). There was also a typo in the XSLT version of the function (missing quotes).