I have an XML file with description and date about events like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="timedate.xsl"?>
<catalog>
<event>
<name>AAA Festival</name>
<place>New York</place>
<country>USA</country>
<date>19/11/2013</date>
</event>
<event>
<name>BBB Festival</name>
<place>Paris</place>
<country>France</country>
<date>11/10/2013</date>
</event>
<event>
<name>CCC Festival</name>
<place>London</place>
<country>UK</country>
<date>29/09/2013</date>
</event>
</catalog>
and an XSL file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<h2>Upcoming events</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Name</th>
<th>Place</th>
<th>Country</th>
<th>Date</th>
</tr>
<xsl:for-each select="catalog/event">
<xsl:sort select="date" order="descending"/>
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="place"/></td>
<td><xsl:value-of select="country"/></td>
<td><xsl:value-of select="date"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I would like to make a page that sort and list only upcoming events (including today date). I'm not able to do this, because dates are not well formatted and I can get current date to compare them and print future events. Please let me know the solution with an example that works. Thanks in advance for your replies and help. Regards!