[Bug 4844] [FO] random() function

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4844





------- Comment #2 from andrew.eisenberg@us.ibm.com  2008-01-18 19:33 -------
While cleaning up some of my email, I noticed that the author of this request
later provided an explanation of his need.

He said, in part, 

"Sometimes you want to hide the logic behind the ordering for a list. Without
any explicit ordering and depending on how items where added to the database, a
resultset could reveal how products differ in price, or freshness. If this is
sensitive information, you could sort by a nonsensitive field, like a name or
something. But sometimes you want to avoid the strict appearance that comes
with alphabetical ordering, or there may not even be any textual data to sort
by. Any type of lottery equivalent. Like a competition where highest score is
shared by multiple contestants, yet there can be only (n) official winners.
Those need to be picked so it doesn't depend on application date, contestant's
name etc. So you sort by random and pick the uppermost (n).Similarly, you want
to show a selection of 10 out of a larger set. It could be a highlight of
products, or a list of online users. Where you don't visitors to say "I've
already seen this exact presentation". Anyway, most RDBMS supports random
ordering, being standard or not. So it's likely that many developers are
already relying on it, and they would expect it to be available in XQuery also,
once they make the transition to xml. By the way, if this feature gets adopted,
maybe it should be discussed for xsl:sort as well?"

Received on Friday, 18 January 2008 19:33:41 UTC