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.