HomeHomeDotNetNuke Forg...DotNetNuke Forg...Module ForumsModule ForumsNews FeedsNews FeedsWorld weather FeedWorld weather Feed
Previous
 
Next
New Post
4/4/2006 6:21 PM
 

Well, normally, you would have to pay for it or create it yourself.  That's where learning about XSL transformations come in real handy.  But since I'm experiencing a grand day here in the midwest, I'll share a sample of an xsl customized for Yahoo Weather.  If it doesn't work quite right for you, search google for some xsl tutor sites.  I'm going outside...

Cheers

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
 xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- RSSv2.0 Yahoo Weather Example by Phil 'iwonder' Guerra -->
<xsl:template match="/">
 <div>
  <xsl:apply-templates select="rss/channel"/>
  </div>
</xsl:template>
<xsl:template match="rss/channel">
<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="head">
 <xsl:if test="$image">
    <a href="{$ilink}" ><xsl:value-of select="ilink" /></a>
    <img src="{$image}" height="{$ihigh}" width="{$iwide}" style="float: left; margin: 2px; border: 0px;"/>
 </xsl:if>
 <font size="-2">
     <a href="{$link}"><xsl:value-of select="substring-after(description,'Yahoo! ')" /></a><br/>
<hr/>
 Sunrise: <xsl:value-of select="yweather:astronomy/@sunrise"/><br/>
  Sunset: <xsl:value-of select="yweather:astronomy/@sunset"/><br/> </font>
 <hr/>
</div>
  <xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
  <xsl:variable name="item_link" select="link"/>
  <xsl:variable name="item_title" select="description"/>
  <div class="subHead">
    <a href="{$item_link}"><xsl:value-of select="title" disable-output-escaping="yes"/></a></div>
 <font size="-2">
 <xsl:value-of select="description" disable-output-escaping="yes"/></font><br/>
 <font size="-3">
  Lat: <xsl:value-of select="geo:lat"/><br/>
  Lon: <xsl:value-of select="geo:long"/><br/>
 (<xsl:value-of select="pubDate"/>)</font><br/> <hr/>
 </xsl:template>
</xsl:stylesheet>

 

 
New Post
11/5/2006 9:29 PM
 

Your assistance is greatly appreciated!! 

 

That was exactly what I had been searching for!

(for my local feed)

 

Thank you

Ken

 
Previous
 
Next
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Module ForumsModule ForumsNews FeedsNews FeedsWorld weather FeedWorld weather Feed


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me
DotNetNuke Store

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Exact Target Exec Alert
r2integrated
Telerik JustCode Free

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.