aspose file tools*
The moose likes XML and Related Technologies and the fly likes xsl:sort - Help Required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xsl:sort - Help Required" Watch "xsl:sort - Help Required" New topic
Author

xsl:sort - Help Required

Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
Hi
I have got a section of XML that looks like:

I want to get a list of orders but sorted by client name and then order id.
i.e. something like :

I have tried all sorts of XPath statements but I have not found the solution, can anyone out there enlighten me.
Thanks


Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
XML:XSL:Output:
[ October 03, 2003: Message edited by: Lasse Koskela ]

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
Thanks Lasse.
I also found another another alternative were I selected all clients in alphabetical order and then select the list of orders for each specific client.
I now need to see which one of these performs best.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I now need to see which one of these performs best.
Might I ask to publish your findings here as well? Of course it's only one, very specific case in a specific environment, but I'm just curious...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: xsl:sort - Help Required
 
Similar Threads
xls:sort question
xslt sorting year problem
Need to write XSL for this XML
Passing an XPath Param value
sort child elements based on its attribute value which is expected to alphanumeric - XSLT