[xsl] how can I rewrite it so I have a variable for year

Subject: [xsl] how can I rewrite it so I have a variable for year
From: "Murray McDonald" <m.mcdonald@xxxxxxxxx>
Date: Fri, 6 Jan 2012 14:27:27 -0500
This is how to pass the year as a parameter to the month template.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>


<xsl:import href="../utilities/date-time.xsl"/>

 

<xsl:template match="data/menu">
  <div id="firstpane" class="menu_list">
     <xsl:apply-templates select="year" />
 </div>
</xsl:template>

<xsl:template match="year">
 <p class="menu_head"> <xsl:value-of select="@value"/>  </p>
  <div class="menu_body">
      <xsl:apply-templates select="month">
		  <xsl:with-param name="theYear" select="@value"/>
      </xsl:apply-templates>
 </div>
</xsl:template>
 
<xsl:template match="month">
 <xsl:param name="theYear" select="'Year not provided'"/>
 <a href="{$root}/dagboek/{$theYear}/{@value}/1" > 
  <xsl:call-template name="format-date">
 <xsl:with-param name="date" select="concat('2222','-',@value,'-01')"/>
 <xsl:with-param name="format" select="'M'"/>
  </xsl:call-template>
</a> 
</xsl:template>
 
</xsl:stylesheet>

Current Thread