Quote:
quote:Originally posted by mhkay
The xsl:apply-templates is an instruction, it needs to go inside a template, for example as a replacement for your current xsl:value-of instruction.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
Hallo Michael. Thanks for your reply. What I did is:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" >
<xsl:param name="day" /> // 3 day weather it is not the parameter of Wochentag
<xsl:param name="wmo"/>//city code
<xsl:param name="zeit"/> // time
<xsl:template match="/">
<xsl:apply-templates select="@Wochentag"/>
<div id="epoPage"><div id="epoHomeContent">
<div id="epoWeather" style="display:blocked">
-----
<xsl:for-each select="WETTERONLINE/prognosen/dreitage[@wmo = $wmo]">
<xsl:for-each select="Tag[@Nummer = $day]">
<tr>
<xsl:template match="@Wochentag[.='Montag']">Monday</xsl:template>
<td height="18" colspan="2" align="left" valign="top"><strong><xsl:value-of select="@Wochentag"/>
<xsl:text> </xsl:text>
<xsl:variable name="year" select="substring(@Datum,3,2)" />
<xsl:variable name="month" select="substring(@Datum,6,2)" />
<xsl:variable name="dayNumber" select="substring(@Datum,9,2)" />
<xsl:value-of select="$dayNumber" />.<xsl:value-of select="$month" />.<xsl:value-of select="$year" /></strong></td>
</xsl:for-each>
</xsl:for-each>
</table></div>
<div id="epoWeatherTab">
<div class="epoWeatherBorderLeft"> <a href="javascript
:Day('1')" ><xsl:if test="$day = '1'"><xsl:attribute name="class" >aktive</xsl:attribute></xsl:if><xsl:value-of select="//Tag[1]/@Wochentag"/></a></div>
<div class="epoWeatherBorderLeft"> <a href="javascript
:Day('2')"><xsl:if test="$day = '2'"><xsl:attribute name="class" >aktive</xsl:attribute></xsl:if><xsl:value-of select="//Tag[2]/@Wochentag"/></a></div>
<div class="epoWeatherBorderLeft"> <a href="javascript
:Day('3')"><xsl:if test="$day = '3'"><xsl:attribute name="class" >aktive</xsl:attribute></xsl:if><xsl:value-of select="//Tag[3]/@Wochentag"/></a></div>
</div></div></div>
</xsl:template>
</xsl:stylesheet>
So now it doesn't give an error for apply-templates but it gives an error for the red marked line. I couldn't get the idea where to put this template value to change the name of the week.