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 appendix, examples use incorrect invocations of fn:fold-left - the order of arguments is ($f, $zero, $seq) - whereas it should be ($seq, $zero, $f). This concerns the following examples (XSLT and XQuery): * eg:distinct-nodes-stable * eg:higheest * eg:lowest Example: declare function eg:highest( $f as function(item()) as xs:anyAtomicType, $seq as item()*) as item()* { fn:fold-left( function($highestSoFar as item()*, $this as item()*) as item()* { let $thisValue := $f($this) let $highestValue := $f($highestSoFar[1]) return if ($thisValue gt $highestValue) then $this else if ($thisValue eq $highestValue) then ($highestSoFar, $this) else $highestSoFar }, fn:head($seq), fn:tail($seq)) };
There is a second bug hidden in the examples eg:highest and eg:lowest: the inline function expression passed to fn:fold-left is function($highestSoFar as item()*, $this as item()*) as item()* {...} Note the second parameter: $this as item()* which is incorrect - it should be $this as item() (no occurrence indicator).
Thanks for reporting it. The problem was fixed as part of the resolution of bug #28885. *** This bug has been marked as a duplicate of bug 28885 ***