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 FeedsUsing the eBay RSS feedUsing the eBay RSS feed
Previous
 
Next
New Post
3/4/2006 4:43 PM
 
I've been experimenting today with trying to utilise the RSS feed from eBay with the news module.  Unforuntately without much success.

I have written an XSL that nicely transforms the raw XML that the eBay RSS feed produces, but when I save this XSL and upload it into the Style Sheet option in the module, it doesn't do anything.

I guess either a) the style sheet option isn't working, or b) there's some kind of pre-transformation going on before the raw feed is given to the nominated style sheet.

Does anyone know? Anyone else tried this?

For interest here's the XSL I've produced.  It works a treat outside of DNN:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
    <xsl:output version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="no" media-type="text/html"/>
    <xsl:template match="/">
        <xsl:for-each select="rss">
            <xsl:for-each select="channel">
                <xsl:for-each select="item">
                    <xsl:for-each select="description">
                        <xsl:apply-templates/>
                    </xsl:for-each>
                </xsl:for-each>
            </xsl:for-each>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

Regards,
Tim Skipper
 
New Post
3/5/2006 9:17 AM
 

Tim,

Can you supply the URL for the feed you are using?  Also, which version of DNN? Another question, what are you using to test this xls? 

I don't remember any of the code doing any transformation prior to processing a given xsl, so it's probably something in the feed that is not being handled by your xsl.  Some items to consider when writing custom xsl files:

- any namespace declaration used in the feed must be included in the xsl to be able to transform the tags that are dependent on the namespace.
- if the feed includes HTMl in any of the tags, you need to allow for it by using something like this example for a description element that includes HTML:
 <xsl:value-of select="description" disable-output-escaping="yes"/>
- ensure that you are using the same character encoding as your srouce feed.

Those are some of the issues I've seen when an xsl 'does nothing'.  Remember that any tag that is not understood, in term of namespace declaration will simply be passed over in the parsing.  I suspect, if you inspect your newsfeed source and take careful note of the above cautions that you can get the feed to work with a proper custom xsl.  Many newsfeeds are not exactly conforming to standard RSS specs, and transformations must be customized to use them efficiently in most web apps.  Standalone news readers are more thorough and can code around most types of these oddities, but I've run into some that are just not playing by the specs and if I want to use them, I have no choice but to provide a custom xsl.

 
New Post
3/5/2006 9:24 AM
 
Hi

I'm using DNN 3.22.  The url for the eBay feed is (this may wrap as it's quite long):

http://rss.api.ebay.com/ws/rssapi?FeedName=StoreItems&UserId=35681440&siteId=3&language=en-GB&output=RSS20&storeId=35681440

Thanks for the response.

Tim.
 
New Post
3/5/2006 10:12 AM
 

There are some issues with your xsl.  The example really doesn't 'do anything' with the items you select from what I see.  So, I'm not sure what you used to test this xsl against the feed.  I use Xselerator from Marrowsoft.

I used the feed with a simple xsl I use for my RSSv2.0 feeds.  I might have to tweak it around a bit to get what I want, but it's a good starting point.  If you are new to xsl and rss, take a look a some other posts on this forum for some tutorial sties that will help with understanding the basics. 

Try this sample xsl with your feed on your site.  It should work, and you can tweak it to get what you feel you need in terms of appearance and such.

Cheers

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- RSSv2.0 Simple XSL 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"/>

<div class="head">
 <xsl:if test="$image">
    <a href="{$ilink}" title="{$idesc}"><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"><xsl:value-of select="description"/><br/>
     <a href="{$link}"><xsl:value-of select="title" /></a><br/>
 <xsl:value-of select="webMaster"/><br/>
 <xsl:value-of select="copyright"/></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">
 (<xsl:value-of select="pubDate"/>)</font><br/> <hr/>
 </xsl:template>
</xsl:stylesheet>

 

 
New Post
3/5/2006 10:46 AM
 
Thanks Phil, that's exactly what I wanted to do.

Cheers
Tim.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsUsing the eBay RSS feedUsing the eBay RSS feed


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