XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
anita anithaSubject: compare 2 date value using xsl
Author: anita anitha
Date: 03 Oct 2008 04:08 AM

current i am having a publish start date field and i need to filter the result based on publish start date <= today.

I tried the below sample to check whether the publishstart date get displayed or not based on the condition publish start date <= today.

It is not working. what is the syntax to filter the output based on publish start date <= today.

<xsl:param name="Today"/>
<xsl:choose>
<xsl:when test="ddwrt:FormatDate(string(publishstartdate) ,1033 ,1) &lt;= ddwrt:FormatDate(string($Today) ,1033 ,1) ">
<xsl:value-of select="ddwrt:FormatDate(string(publishstartdate) ,1033 ,1)"/>
</xsl:when>
</xsl:choose>

Posttop
(Deleted User) Subject: compare 2 date value using xsl
Author: (Deleted User)
Date: 13 Oct 2008 08:27 AM
Hi Anita,
you should probably check what your FormatDate function is doing; if the 1033 arguments means "english localization", the date you are getting is not in the best format to be compared. You should instead build a string in the format YYYYMMDD

Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.