I need to set high temp for the day as 78 and the low as 60. I am a beginner and would like to know how could i do this in xsl. I was thinking of doing something with the time of day, but not sure. Thanks for your help in advance.
sample code of xml below.
`<forecast>-
<dailyForecastPeriods>
<temperature>78</temperature><forecastDateLocalStr>2014-07-18T07:00:00</forecastDateLocalStr><forecastDateUtcStr>2014-07-18T11:00:00Z</forecastDateUtcStr><isNightTimePeriod>false</isNightTimePeriod>
</dailyForecastPeriods>
-<dailyForecastPeriods>
<temperature>60</temperature><forecastDateLocalStr>2014-07-18T19:00:00</forecastDateLocalStr><forecastDateUtcStr>2014-07-18T23:00:00Z</forecastDateUtcStr><isNightTimePeriod>true</isNightTimePeriod>`
Sample of xsl
`<tr>
<xsl:for-each select="//forecast/dailyForecastPeriods">
<xsl:if test="position() > $startIndex">
<xsl:if test="position() <= ($numDays)+$startIndex">
<td title="{detailedDescription}" align="center"
valign="top"class="weatherforecasttemp">
<span class="weatherforecasthigh">
<xsl:value-of select="temperature"/>
<xsl:text>°</xsl:text>
</span>
<xsl:text> </xsl:text>
<span class="weatherforecastlow">
<xsl:value-of select="temperature" />
<xsl:text>°</xsl:text>
</span>
</td>
</xsl:if>
</xsl:if>
</xsl:for-each>
</tr>`
No comments:
Post a Comment