[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: IF-ELSE.. Sorting

Subject: Re: Re: IF-ELSE.. Sorting
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 18 Jun 2001 04:50:16 -0700 (PDT)
if else xml
Oliver Becker wrote:

> Hi Karlo,
> 
> > * Hi, I am trying to do a conditional sort. I want to have a look at an
> > input parameter $arrangeby and if this is of Type DATE then I would like to
> > specify a sorting different from my usual
> > 
> > <xsl:sort select="*[name()=$arrangeby]"/>
> 
> not as easy as you might hope ...
> 
> Jeni Tennisson posted a nice explanation about this. Check out:
> http://www.biglist.com/lists/xsl-list/archives/200102/msg00191.html


This nice explanation illustrates extremely well why we need to use a generic sort
template in this case.

While any use of a generic sort() will be natural, any attempt to use xsl:sort for
cases far from the most trivial -- these will look perverted and totally
incomprehensible to anybody but their author.

This is because xsl:sort needs a sort-key as ***one*** expression to be specified as
the value of its select attribute.

Contrary to this, a generic sort template leaves to the caller-supplied template the
definition of what a sort-key is and how sort-keys should be compared.

Cheers,
Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.