This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
compare date value with 2 other ones
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] compare date value with 2 other ones
- From: Kristof Bernaert <kbernaert at 1eEurope dot be>
- Date: Thu, 5 Apr 2001 11:14:29 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
Take the current date with this format: 05/04/2001
i have this xml with some news-blocks
<news>
<block startdate="03/04/2001" endddate="06/04/2001" id="1">news 1</block>
<block startdate="05/04/2001" endddate="10/04/2001" id="2">news 2</block>
</news>
I have an extern xml-file (current_date.xml, in same root of other *.xml)
that contains always current date like this
<current_date>05/04/2001</current_date>
now, in xsl i want only view the newsblocks where currentdate is between the
start- and enddate.
<xsl:for-each select="news/block[@startdate =>
document(current_date.xml)/current_date and @enddate =<
document(current_date.xml)/current_date]">
<xsl:apply-templates/>
</xsl:for-each>
of course, this isn't working, because:
How have i to handle the date ? to compare correctly the day, month and year
?
thx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list