xsl-list
[Top] [All Lists]

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

2012-01-06 13:27:36
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>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>