<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  version = "1.0"
  xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
  xmlns:content = "http://purl.org/rss/1.0/modules/content/"
  exclude-result-prefixes = "content"
>
  <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
  <!-- RssWeather by David Walker - www.davidlwalker.com and www.sharepointpowertoys.com -->
  <xsl:template match="/">
      <xsl:apply-templates select="rss/channel/item[1]"/>
  </xsl:template>
  <xsl:template match="rss/channel/item">
    <xsl:variable name="link" select="link"/>
    <xsl:variable name="description" select="description"/>
    <xsl:variable name="image" select="image/url"/>
    <xsl:variable name="idesc" select="image/description"/>
    <xsl:variable name="ilink" select="image/link"/>
    <xsl:variable name="iwide" select="image/width"/>
    <xsl:variable name="ihigh" select="image/height"/>
    <!--<xsl:variable name="Sunrise" select="/yweather:astronomy/@sunrise"/>-->
    <div class="weather">
        <a href="{$link}">
          <xsl:value-of select="substring-after(title,':: ')" />
        </a><br/>
      <xsl:value-of disable-output-escaping="yes" select="current()/content:encoded"/>
    </div>
  </xsl:template>
</xsl:stylesheet>

RSSWeather.xsl

Last edited Jun 28, 2008 at 4:17 AM by davidlwalker, version 2

Comments

No comments yet.