[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Selection based on date comparison
I would have thought to use substring to grab the substrings into variables and then piece the date back together into yyyymmdd format for easy comparison. Clumsy demo implementation of rebuild follows: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="./Untitled3.xsl"?> <date-sample> <date name="1" date="06/24/2001"/> <date name="2" date="05/29/2000"/> </date-sample> <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="date-sample"> <html> <body> <xsl:for-each select="date"> <xsl:variable name="date"><xsl:value-of select="substring(@date,7,4)"/><xsl:value-of select="substring(@date,1,2)"/><xsl:value-of select="substring(@date,4,2)"/></xsl:variable> <xsl:value-of select="@name"/>) <xsl:value-of select="@date"/> = <xsl:value-of select="$date"/><br/> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> - Theo -----Original Message----- From: Jeff Beadle [mailto:Jbeadle@xxxxxxxx] Sent: Friday, November 30, 2001 2:24 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: Selection based on date comparison why not use a parser extension, like msxsl for msxsl. You could construct javascript date objects and compare them. -----Original Message----- From: Dennis Campillo [mailto:dcampillo@xxxxxxx] Sent: Friday, November 30, 2001 2:15 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Selection based on date comparison >But the date format you choose is unsuited for compraision. Use >something like 20010603. >If you cant, you will have to use substring(). > Unfortunately, the date format is beyond my control at the moment, I understand I will have to use substring() in order to compare the dates. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|