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

RE: Selection based on date comparison

Subject: RE: Selection based on date comparison
From: "Brinkman, Theodore" <Theodore.Brinkman@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Nov 2001 14:49:49 -0500
javascript 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


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.