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 FeedsRSS feed shows html tagsRSS feed shows html tags
Previous
 
Next
New Post
7/7/2008 1:26 PM
 

It seems that I have a similar problem as other for applying XSL file to the RSS Feed.

I am trying to insert  a feed from http://www.wyndhamworldwide.com/media_center/pr/feed_server.cfm?category=1&language=en&format=rss1.

I have applied your previous XSL sample, but it seem it is not transofrming anything. The whole page information is dumped into the module showing everything in html tags.

Could you please help me on the XSL file for this feed? I need some kind of hint to put me in the right direction.

Thanks,

Kamal 

 
New Post
7/8/2008 3:23 PM
 

Inspecting the newfeed source (view source), I see it's an RDF formated newsfeed.  My stock xsl will give you a basic transformation of the feed.  I use this xsl as a starting point for RDF, RSS, and Atom formatted newsfeeds.  It works 90% of the time, and I may mod it for display purposes later, but it should get you going.

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>

 
New Post
7/25/2008 12:01 PM
 

Here's a simpler XSL template that I'm using in one of my projects. Save it as "Rss.xsl" and upload it to your DotNetNuke portal. Then in the News feed options, choose "Select an existing file" and select "Rss.xsl".

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" media-type="text/html" />

    <xsl:template match="rss/channel">
        <xsl:apply-templates select="title" />
        <xsl:apply-templates select="item" />
    </xsl:template>

    <xsl:template match="title">
        <div class="ChannelTitle">
            <xsl:value-of select="text()" />
        </div>
        <br />
    </xsl:template>

    <xsl:template match="item">
        <div class="ArticleEntry">
            <div class="ArticleTitle">
                <a href="{link}" target="_blank">
                    <xsl:value-of select="title" />
                </a>
                -
                <span class="ArticleDate">
                    <xsl:value-of select="pubDate" />
                </span>
            </div>
            <div class="ArticleDescription">
                <xsl:value-of select="description" disable-output-escaping="yes" />
            </div>
        </div>
        <br />
    </xsl:template>
</xsl:stylesheet>

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsRSS feed shows html tagsRSS feed shows html tags


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