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 HelpXSL Help
Previous
 
Next
New Post
9/13/2012 11:05 AM
 

I'm trying to understand this module.  I have 2 feeds that I'm trying to aggregate:

www.curling.ca/feed and http://rss.cbc.ca/lineup/sports-curli...

The CBC feed displays exactly how I want it using the Default.xsl transform.  A title, date, image and description.  The curling.ca feed is missing the image from the <description> so I'm trying to add it in the transform.  It's URL can be found in the item\custom_fields\image node.

I created the following transform which is giving me the correct HTML output when viewing it from XMLper.com but when I use this transform in the Feed setup, the feed cache is not showing this markup so I'm still missing the image when I apply the aggregated transform. 

<?xml version="1.0"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html" indent="yes"/>
  <xsl:param name="ShowItemDetails">true</xsl:param>
  <xsl:param name="ShowItemDate">true</xsl:param>
  <xsl:param name="Target">_blank</xsl:param>
 <xsl:template match="rss">
  <xsl:for-each select="channel/item">
   <h4>
    <a href="{link}">
     <xsl:attribute name="target"><xsl:value-of select="$Target"/></xsl:attribute>
     <xsl:value-of select="title"/>
    </a>
   </h4>
   <xsl:if test="$ShowItemDate='true'">
    <h6>
      <xsl:call-template name="format-date">
      <xsl:with-param name="date" select="pubDate"/>
      </xsl:call-template>
    </h6>
   </xsl:if>
   <xsl:if test="$ShowItemDetails='true'">
     <xsl:if test="custom_fields/image">
       <img src="{custom_fields/image}" /><br />
     </xsl:if>
     <p class="Normal">
       <xsl:value-of select="description" disable-output-escaping="yes"/>
     </p>
   </xsl:if>
  </xsl:for-each>
 </xsl:template>
 <xsl:template name="format-date">
  <xsl:param name="date"/>
  <xsl:variable name="day" select="substring-before(substring-after($date, ' '), ' ')"/>
  <xsl:variable name="day2" select="concat(translate(substring($day,1,1), '0', ''), substring($day,2,1))"/>
  <xsl:variable name="monthName" select="substring-before(substring-after(substring-after($date, ' '), ' '), ' ')"/>
  <xsl:variable name="year" select="substring-before(substring-after(substring-after(substring-after($date, ' '), ' '), ' '), ' ')"/>
  <xsl:variable name="month">
   <xsl:choose>
    <xsl:when test="$monthName = 'Jan'">January</xsl:when>
    <xsl:when test="$monthName = 'Feb'">February</xsl:when>
    <xsl:when test="$monthName = 'Mar'">March</xsl:when>
    <xsl:when test="$monthName = 'Apr'">April</xsl:when>
    <xsl:when test="$monthName = 'May'">May</xsl:when>
    <xsl:when test="$monthName = 'Jun'">June</xsl:when>
    <xsl:when test="$monthName = 'Jul'">July</xsl:when>
    <xsl:when test="$monthName = 'Aug'">August</xsl:when>
    <xsl:when test="$monthName = 'Sep'">September</xsl:when>
    <xsl:when test="$monthName = 'Oct'">October</xsl:when>
    <xsl:when test="$monthName = 'Nov'">November</xsl:when>
    <xsl:when test="$monthName = 'Dec'">December</xsl:when>
    <xsl:otherwise/>
   </xsl:choose>
  </xsl:variable>
  <xsl:value-of select="concat($month, ' ', $day2, ', ', $year)"/>
 </xsl:template>
</xsl:stylesheet>

The way I understand it, each feed in the aggregator uses the transform supplied to create the cached copy of the feed source.  Then, when the feed is displayed, it uses the module level transform to create the final HTML for display.  Is this correct?

I also tried the following transform in each feeds settings just to see what gets downloaded to the cache in the background.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="xml" indent="yes"/>
  <xsl:template match="/">
    <xsl:copy-of select="."/>
  </xsl:template>
</xsl:stylesheet>

The custom_fields\image nodes are still missing...

I'm not an XSL expert but I'm confused by what I'm experiencing.

 
New Post
10/4/2012 3:30 PM
 

Does anyone know how to retrieve the item/custom_fields/image from the feed (http://www.curling.ca/feed) and include it in my transform?

I was perusing the source code and I'm wondering it the module is limited to only properties defined in the RssItem class?  Or perhaps I need to modify Rss20.xsd to include the custom elements?

Any help?

 
New Post
10/5/2012 11:12 AM
 

I found that the feed XML is invalid due to the custom_fields element not defined being in any namespace.  I modified the Rss20.xsd to include the custom_fields complexType and the feed XML now passes validation.  However, after reinitializing the feed cache, the custom_fields element is still being ignored.  I'm assuming the cached feed XML is being created using the RssItem class (even though I can't find it in the source code) which does not include an associated property.

At this point, I have no choice but to give up...

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsXSL HelpXSL Help


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