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

RE: sort by date

Subject: RE: sort by date
From: "Aniceto Lopez" <aniceto@xxxxxxxxxxxxx>
Date: Tue, 26 Nov 2002 18:46:58 +0100
vbscript sort by date
Thanks Shenan but:
the clause is AUTO
where this script should be placed?
the xslt is java one, not Microsoft
does it help?

Ani



-----Mensaje original-----
De: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]En nombre de Shenan
Hawkins
Enviado el: martes, 26 de noviembre de 2002 18:27
Para: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Asunto: RE:  sort by date



That looks like a date that was returned by SQL Server FOR XML clause(?)

I sometimes need to deal with those strings as well.

Here are some (MS) functions I use below (I'm sure there is a _much_
better way to do this, though):


	<msxsl:script language="VBScript" implements-prefix="user">
	<![CDATA[ 
		function getAge(in_dteDate)
			getAge = replace(in_dteDate, "T", " ")
			getAge = dateDiff("d", getAge, now)
		end function


		function getDate(Node)
			getDate = replace(Node, "T", " ")
			getDate = formatDateTime(getDate, 1)
		end function


		function getTime(Node)
			getTime = replace(Node, "T", " ")
			getTime = formatDateTime(getTime, 3)
		end function	
		
	]]> 
	</msxsl:script>

And then, for example:

<xsl:value-of select="user:getAge(string(@date))" />



Shenan



-----Original Message-----
From: Aniceto Lopez [mailto:aniceto@xxxxxxxxxxxxx] 
Sent: Tuesday, November 26, 2002 12:16 PM
To: xsl-list
Subject:  sort by date


Hi:
I'm trying to sort by date but the date format is
a little bit extrange:

<a4013-list>
  <a4013 date="1998-01-03T00:00:00">FRUTAS</a4013>
  <a4013 date="1999-12-03T00:00:00">FRUTAS</a4013>
  <a4013 date="1999-05-03T00:00:00">FRUTAS</a4013>
  <a4013 date="2001-12-03T00:00:00">FRUTAS</a4013>
  <a4013 date="2001-12-03T00:00:00">FRUTAS</a4013>
  <a4013 date="1999-07-03T00:00:00">FRUTAS</a4013>
  <a4013 date="1999-12-03T00:00:00">FRUTAS</a4013>
  <a4013 date="2002-12-03T00:00:00">FRUTAS</a4013>
  <a4013 date="2002-07-03T00:00:00">FRUTAS</a4013>
</a4013-list>

the "T00:00:00" has no use but some one can point an
idea to get the desired sort by date?

thanks in advance
Ani

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


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




 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.