xsl/calendar-summary: skip events older than 1 year

should speed up build process by much
This commit is contained in:
Astro 2012-03-06 19:06:38 +01:00
parent e6fff13329
commit 2ca0fcf4f7
1 changed files with 34 additions and 30 deletions

View File

@ -29,36 +29,40 @@
<xsl:template match="event"> <xsl:template match="event">
<xsl:param name="link"/> <xsl:param name="link"/>
<event> <!-- Events must have started at least one year ago -->
<title> <xsl:variable name="minstart" select="date:add(date:date-time(), '-P366D')"/>
<xsl:choose> <xsl:if test="starts-with(date:difference(start, $minstart), '-')">
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when> <event>
<xsl:when test="../@title"><xsl:value-of select="../@title"/></xsl:when> <title>
<xsl:otherwise> <xsl:choose>
<xsl:message terminate="yes">Event with no title!</xsl:message> <xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
</xsl:otherwise> <xsl:when test="../@title"><xsl:value-of select="../@title"/></xsl:when>
</xsl:choose> <xsl:otherwise>
</title> <xsl:message terminate="yes">Event with no title!</xsl:message>
<start><xsl:value-of select="start"/></start> </xsl:otherwise>
<end> </xsl:choose>
<xsl:choose> </title>
<xsl:when test="end"> <start><xsl:value-of select="start"/></start>
<xsl:value-of select="end"/> <end>
</xsl:when> <xsl:choose>
<xsl:otherwise> <xsl:when test="end">
<xsl:value-of select="start"/> <xsl:value-of select="end"/>
</xsl:otherwise> </xsl:when>
</xsl:choose> <xsl:otherwise>
</end> <xsl:value-of select="start"/>
<location><xsl:value-of select="location"/></location> </xsl:otherwise>
<link> </xsl:choose>
<xsl:choose> </end>
<xsl:when test="link"><xsl:value-of select="link"/></xsl:when> <location><xsl:value-of select="location"/></location>
<xsl:otherwise><xsl:value-of select="$link"/></xsl:otherwise> <link>
</xsl:choose> <xsl:choose>
</link> <xsl:when test="link"><xsl:value-of select="link"/></xsl:when>
<!-- TODO: Link --> <xsl:otherwise><xsl:value-of select="$link"/></xsl:otherwise>
</event> </xsl:choose>
</link>
<!-- TODO: Link -->
</event>
</xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>