]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/approaching-deadlines.xsl
* Notion of future and past events/deadlines introduced.
[helm.git] / helm / mowgli / home / xsl / approaching-deadlines.xsl
index bb1a41d5c2f628b164dd6d74591c7aa5c0e08c76..ced2defa88822b23bcbf6bdeb1f6c893c1f08616 100644 (file)
@@ -8,12 +8,16 @@
 
 <xsl:output method="html"/>
 
+<xsl:param name="today"/>
+
 <xsl:template match="/">
-  <xsl:variable name="deadlines" select="events/event[position() &lt; 4]/deadline"/>
-  <xsl:apply-templates select="$deadlines">
-    <xsl:sort select="date" data-type="number"/>
-  </xsl:apply-templates>
+  <h3>Approaching Deadlines:</h3>
+  <xsl:for-each select="events/event/deadline[date &gt;= $today]">
+   <xsl:sort select="date" data-type="number"/>
+   <xsl:if test="position() &lt; 4">
+    <xsl:apply-templates select="."/>
+   </xsl:if>
+  </xsl:for-each>
 </xsl:template>
 
 </xsl:stylesheet>
-