Subject: RE: Unusual Sort
From: "Williamson, Chris" <cwilliamson@xxxxxxxxx>
Date: Wed, 13 Apr 2005 14:41:20 -0400
|
Wow... It really wasn't this important. I will attempt the one guys actual
related response. Thanks to everyone who attempted a response and to
everyone else for the flames.. It's like a yahoo chat room without the porn
bots. :)
Thanks,
Chris
-----Original Message-----
From: Aron Bock [mailto:aronbock@xxxxxxxxxxx]
Sent: Wednesday, April 13, 2005 2:13 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: Unusual Sort
David, *I* didn't ask the question, but nice, especially because the XSL is
simply a concretization of a way of approaching a problem.
I'm reminded of a problem presented to Ken Thompson (the UNIX guy): find
which words in a list are anagrams of one another. His solution was
beautifully elegant, especially for its simplicity. It consisted of the
following:
--for each word, generate a "key"--which is simply a word consisting of the
original word's characters sorted. Eg. for word "apple", the key is "aelpp"
--sort list based on key --extract groups of keys; their corresponding words
are anagrams of one
another
And this is succintly expressed as an UNIX pipeline.
Anyway, your <xsl:sort select="translate('FSJ','ABC',grade)"/> gives me a
similar feeling!
:-)
--A
>From: "Williamson, Chris" <cwilliamson@xxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'"
><xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Subject: Unusual Sort
>Date: Wed, 13 Apr 2005 10:33:42 -0400
>
>I was wondering if there is any way to sort elements other than just
>the regular alphabetical order. For example, If you wanted to sort
>grade levels (Freshman, Sophmore, Junior, etc) so that they are
>displayed in the correct order and not the alphabetical order
>(Freshman, Graduate, Junior, Senior, Sophmore). This is an optional
>piece of my application so if It can't be done fairly easily I will
>probably not worry about creating the functionality of the sort on
>page..in other words if it's a huge deal don't worry about going to the
>trouble of creating the sort.. Just let me know.
>
>Thanks
>
>Chris
>
>
>
>From: David Carlisle <davidc@xxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: Re: Unusual Sort
>Date: Wed, 13 Apr 2005 15:42:39 +0100
>
><xsl:sort select="translate('FSJ','ABC',grade)"/>
>
>David
_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
|