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 following example for $a in fn:distinct-values(/bib/book/author) return ($a, /bib/book[author = $a]/title) does not produce the output illustrated. It returns a heterogenous sequence containing strings (the result of atomizing an author element) and title elements. The result of distinct-values() is an atomic sequence. The example could be corrected to: for $a in fn:distinct-values(/bib/book/author) return (/bib/book/author[. = $a], /bib/book[author = $a]/title) But I think it would be best to replace this example with a more realistic one: in practice this problem would be tackled using xsl:for-each-group. (Problem with this example was pointed out by Bob du Charme on the Saxon list.)
Michael, Thanks for your comment. I have corrected the example in Section 3.7 as you suggested. I consider this to be an editorial correction. If you wish to suggest a specific alternative example, please send it to me. Regards, --Don Chamberlin