xsl-list
[Top] [All Lists]

Re: order-by vs xsl:sort

2005-04-29 06:40:44

Isn't this simpler?

well yes but it doesn't work in general. As in this simple case you
could force the returned values to be a string so you could stick them
all in a sequence. In general if the returned values are a sequence you
can't put them in a sequence without having it all being flattened (which
is why they have to invent tuples, aka sequences of sequences to
describe this in the spec).

Also in general you need the actual value for sorting as a number or
whatever not just its string representation.
I don't think this is possible using this kind of construct (I started
somewhere around there...:-)

In other words, I'm not really interested in the example I posted but I
am interested in a general procedure to express

for $i in $is,  $j in $js
order by f($i,$j)
return
g($i,$j)

in xslt for arbitrary sequences $is and $js and arbitrary functions f
and g.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>