Hardware Reference
In-Depth Information
into text like this:
day:Tuesday
description:Mostly Cloudy
low:30
high:36
end:
day:Wednesday
description:Partly Cloudy
low:26
high:35
end:
That is perfect for speech output, status reports, or e-mail. The makedata.xsl file, however, is a little more
fulsome:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl=" http://www.w3.org/1999/XSL/Transform "
xmlns:scripts=" http://www.bluedust.com/sayweather "
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:yweather=" http://xml.weather.yahoo.com/ns/rss/1.0 ">
<xsl:output method="text" encoding="utf-8" media-type="text/plain"/>
<xsl:template match="/">
<xsl:apply-templates select="rss"/>
<xsl:apply-templates select="channel"/>
</xsl:template>
<xsl:template match="channel">
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<xsl:apply-templates select="yweather:forecast"/>
</xsl:template>
<xsl:template match="yweather:forecast">
<xsl:text>day:</xsl:text>
<xsl:if test="@day = 'Mon'">
<xsl:text>Monday</xsl:text>
</xsl:if>
<xsl:if test="@day = 'Tue'">
<xsl:text>Tuesday</xsl:text>
</xsl:if>
Search WWH ::




Custom Search