Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsXSL for atom/blogger feeds?XSL for atom/blogger feeds?
Previous
 
Next
New Post
9/21/2007 1:43 AM
 

Here's an example that works with my blogger site feed: http://wizzodawg.blogspot.com/feeds/posts/default 

It's simple, but gives you an idea of what's involved.  It does not include all of the namespaces in the feed, but is actually one that I worked on as an 'All-In-One' type of xsl that I use for a lot of differ rss newsources.  You can modify it and play with it.  Of course, it may not work for you depending on the URL and feed you are using, but if you have facility with RSS and XSL, it should get you on the way.

Cheers

<?xml version="1.0" encoding="UTF-8"?>
        <xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:atom="http://www.w3.org/2005/Atom"
                xmlns:rss="http://purl.org/rss/1.0/"
                xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/"
                exclude-result-prefixes="xsl rdf dc rss rss09 atom"
                >
<!-- All_In_One - a bit more advanced stylesheet - Phil 'iwonder' Guerra -->

        <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

        <xsl:template match="/">
                <div>
                <xsl:apply-templates select="rdf:RDF/rss:channel" />
                <xsl:apply-templates select="rdf:RDF/rss09:channel" />
       <xsl:apply-templates select="/atom:feed"/>
               <xsl:apply-templates select="rss/channel" />
                <xsl:if test="rdf:RDF/rss:item">
                        <ul><xsl:apply-templates select="rdf:RDF/rss:item"/></ul>
                </xsl:if>
                <xsl:if test="rdf:RDF/rss09:item">
                        <ul><xsl:apply-templates select="rdf:RDF/rss09:item"/></ul>
                </xsl:if>
                </div><font size="1"><i>(iwonder All_In_One)</i></font>      
        </xsl:template>

        <xsl:template match="rss:channel">
                <xsl:variable name="link" select="rss:link"/>
                <xsl:variable name="description" select="rss:description"/>
                <xsl:variable name="image" select="/rdf:RDF/rss:image/rss:url"/>
                <xsl:if test="$image"> 
                        <img src="{$image}" style="float: right; margin: 2px;" />
                </xsl:if>
                <h2><a href="{$link}" ><xsl:value-of select="rss:title" /></a></h2>

     <h3><xsl:value-of select="rss:description" /></h3>
                <hr/>
        </xsl:template>

        <xsl:template match="rss09:channel">
                <xsl:variable name="link" select="rss09:link"/>
                <xsl:variable name="description" select="rss09:description"/>
                <xsl:variable name="image" select="/rdf:RDF/rss09:image/rss09:url"/>
                <xsl:if test="$image"> 
                        <img src="{$image}" style="float: right; margin: 2px;" />
                </xsl:if>
                <h3><a href="{$link}"><xsl:value-of select="rss09:title" /></a></h3>

     <h4><xsl:value-of select="rss:description" /></h4>
                <hr/>
        </xsl:template>

        <xsl:template match="channel">
                <xsl:variable name="link" select="link"/>
                <xsl:variable name="description" select="description"/>
                <xsl:variable name="image" select="image/url"/>
                <xsl:if test="$image"> 
                        <img src="{$image}" style="float: right; margin: 2px;" />
                </xsl:if>
                <h3><a href="{$link}" title="{$description}"><xsl:value-of select="title" /></a></h3>
                <hr/>
                <ul><xsl:apply-templates select="item"/></ul>
        </xsl:template>

        <xsl:template match="item">
                <xsl:variable name="item_link" select="link"/>
                <xsl:variable name="item_title" select="description"/>
                <li><a href="{$item_link}" title="{$item_title}"><xsl:value-of select="title"/></a></li>
        </xsl:template>

        <xsl:template match="rss:item">
                <xsl:variable name="item_link" select="rss:link"/>
                <xsl:variable name="item_title" select="rss:description"/>
                <li><a href="{$item_link}"><xsl:value-of select="rss:title"/></a></li>

     <h4><xsl:value-of select="rss:description" disable-output-escaping="yes"/></h4>
        </xsl:template>

        <xsl:template match="rss09:item">
                <xsl:variable name="item_link" select="rss09:link"/>
                <xsl:variable name="item_title" select="rss09:description"/>
                <li><a href="{$item_link}" title="{$item_title}"><xsl:value-of select="rss09:title"/></a></li>
        </xsl:template>


 <xsl:template match="/atom:feed">
  <div class="syndication-content-area">
   <div class="syndication-title">
    <xsl:value-of select="atom:title"/>
   </div>
   <div class="syndication-description">
    <xsl:value-of select="atom:tagline"/>
   </div>
   <ul class="syndication-list">
    <xsl:apply-templates select="atom:entry"/>
   </ul>
  </div>
 </xsl:template>

 <xsl:template match="atom:entry">
  <li class="syndication-list-item">
   <a href="{atom:link/@href}">
    <xsl:value-of select="atom:title"/>
   </a>
   <div>
   <span class="syndication-list-item-date">
     (Updated: <xsl:value-of select="atom:updated"/>)
   </span>
   </div>
<!--   <div class="syndication-list-item-description">
    <xsl:value-of select="atom:summary"/>
   </div>
-->
  </li>
 </xsl:template> 
</xsl:stylesheet>

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsXSL for atom/blogger feeds?XSL for atom/blogger feeds?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out