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

RE: Sorting by one of many

Subject: RE: Sorting by one of many
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 24 Jun 2004 14:21:46 +0100
date2 stylus
If you know that date1 precedes date2 in document order, and so on, you can
write

<xsl:sort select="(date1|date2|date3|date4)[1]"/>

In XSLT 2.0, you can do it whether or not the dates are in document order,
by writing

<xsl:sort select="(date1,date2,date3,date4)[1]"/>

Michael Kay 

> -----Original Message-----
> From: Isuls Matts [mailto:matts.isuls@xxxxxx] 
> Sent: 24 June 2004 11:50
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Sorting by one of many 
> 
> Hi
> 
> Challenging sort problem for me. The rows can hold one to 
> four dates and output should be sorted by only one. date1 
> being primary and if that is missing date2 and so on. How can 
> this be efficiently done?  
> 
> 
> <root>
> 	<row>
> 		<name>A</name>
> 		<date2>20040101</date2>
> 	</row>
> 	<row>
> 		<name>C</name>
> 		<date3>20040103</date3>
> 		<date4>20040109</date4>
> 	</row>
> 	<row>
> 		<name>B</name>
> 		<date1>20040102</date1>
> 		<date3>20040101</date3>
> 	</row>
> </root>
> 
> 
> //matts
> 
> 
> --+------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> 


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.