Avoid outputting an <image/> element without an empty <url/>, this
breaks validation.
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
+ <xsl:variable name="channel-image" select="//ProfilePage/user/profile_pic_url"/>
<rss version="2.0">
<xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute>
<rss version="2.0">
<xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute>
</xsl:if>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
</xsl:if>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
- <image>
- <title>
- <xsl:value-of select="$channel-title"/>
- </title>
- <link>
- <xsl:value-of select="$channel-link"/>
- </link>
- <url>
- <xsl:value-of select="//ProfilePage/user/profile_pic_url"/>
- </url>
- </image>
+ <xsl:if test="$channel-image != ''">
+ <image>
+ <title>
+ <xsl:value-of select="$channel-title"/>
+ </title>
+ <link>
+ <xsl:value-of select="$channel-link"/>
+ </link>
+ <url>
+ <xsl:value-of select="$channel-image"/>
+ </url>
+ </image>
+ </xsl:if>
<xsl:apply-templates select="//ProfilePage/user/media/nodes|//LocationsPage/location/media/nodes"/>
</channel>
</rss>
<xsl:apply-templates select="//ProfilePage/user/media/nodes|//LocationsPage/location/media/nodes"/>
</channel>
</rss>