From: Antonio Ospite <ao2@ao2.it> Date: Sat, 24 Feb 2018 14:33:58 +0000 (+0100) Subject: rss_converter_instagram.com.xsl: fix validation for Instagram location feeds X-Git-Tag: v1.2.0~1 X-Git-Url: https://git.ao2.it/tweeper.git/commitdiff_plain/7e49b0f4dd905f32ffc2df7070ec8220deaa32d3?hp=78ffdd0963e354dae561414aec7893336928ecc1 rss_converter_instagram.com.xsl: fix validation for Instagram location feeds Avoid outputting an <image/> element without an empty <url/>, this breaks validation. --- diff --git a/src/rss_converter_instagram.com.xsl b/src/rss_converter_instagram.com.xsl index 58cc19c..a2de8b3 100644 --- a/src/rss_converter_instagram.com.xsl +++ b/src/rss_converter_instagram.com.xsl @@ -121,6 +121,7 @@ </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> @@ -141,17 +142,19 @@ </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>