Hello,
You gave me an idea .. sorting was missing to xmlgen .. so I've
added that feature
If your property files are Xml; you can sort on any Xml element
with or without XPath criteria for example :
$addressBook.sort($names)
$library.sort($books,"./author/text()")
(http://xmlgen.sf.net)
Philippe
Florin Vancea wrote:
Use the SortTool
http://velocity.apache.org/tools/devel/generic/ look for SortTool.
----- Original Message -----
From: "cha" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, September 21, 2007 10:20 AM
Subject: how to Sort the List
Hi All,
Am trying to sort the list of First Alphabets of merchants but cant able
to
do that. It seems that Collections.sort($List)) is not working.
Below is my sample code:
#foreach ($merchant in $merchants)
#if (!$List.contains($merchant.getName().substring(0,1).toUpperCase()))
#set ($boolean =
$List.add($merchant.getName().substring(0,1).toUpperCase()))
#end
#end
Collections.sort($List))
Please do let me know, how to accomplish sorting in Velocity.
Cheers,
Cha
--
View this message in context:
http://www.nabble.com/how-to-Sort-the-List-tf4492216.html#a12811877
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Philippe Collignon
IT Consultant
Starobject S.A.
Rue Principale, 56
L-5367 Schuttrange
Luxembourg
+352621312040
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]