tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LANTRES Franck" <Franck.LANT...@fr.renault-sport-f1.com>
Subject RE: xtags:forEach - integer sorting
Date Tue, 11 Oct 2005 08:17:54 GMT
Is it possible to set an XPath expression as 'sort' tag value ?
I tried sort="number(value)" but it doesn't work.

Franck



> -----Message d'origine-----
> De : Oded Arbel [mailto:oded@m-wise.com] 
> Envoyé : mardi 11 octobre 2005 10:05
> À : taglibs-user@jakarta.apache.org
> Cc : LANTRES Franck
> Objet : Re: xtags:forEach - integer sorting
> 
> On Tuesday, 11 בOctober 2005 09:56, LANTRES Franck wrote:
> > Hi,
> >
> > In a JSP, I use the xtags:forEach element and I would like to sort 
> > elements in descending order according to an integer value.
> 
> > And if I write :
> > <xtags:forEach select="/foo/list" sort="value" ascending="false"/>
> >
> > The result I get is :
> > 6
> > 56
> > 4
> > 2
> 
> Which is reasonable, as forEach does string sorting. You 
> might want to either pad numbers with zeros or white space, 
> or sort them yourself somehow.
> 
> --
> Oded Arbel
> m-Wise mobile solutions
> oded@m-wise.com
> 
> +972-9-9611212 (204)
> +972-54-7340014
> 
> ::..
> Never express yourself more clearly than you think. 
> 	-- N. Bohr
> 
Mime
View raw message