From: Antonio Ospite Date: Sat, 22 Feb 2014 08:52:38 +0000 (+0100) Subject: rss_converter_*.xsl: specify xml:base X-Git-Tag: v0.3~5 X-Git-Url: https://git.ao2.it/tweeper.git/commitdiff_plain/a46377bc66c36851643b1f5a57c7f59380cab183 rss_converter_*.xsl: specify xml:base Some feed readers expand relative URLs in items by extracting the base URL from the enclosing element, however this is not a globally accepted practice. Specifying xml:base is useful to cover other ways in which relative URLs are expanded, see: https://cyber.law.harvard.edu/rss/relativeURI.html http://www.w3.org/TR/xmlbase/#resolution --- diff --git a/rss_converter_dilbert.com.xsl b/rss_converter_dilbert.com.xsl index 7394b91..0fb28fc 100644 --- a/rss_converter_dilbert.com.xsl +++ b/rss_converter_dilbert.com.xsl @@ -65,6 +65,7 @@ + Tweeper diff --git a/rss_converter_pump.io.xsl b/rss_converter_pump.io.xsl index 6b05d0c..b127f3a 100644 --- a/rss_converter_pump.io.xsl +++ b/rss_converter_pump.io.xsl @@ -26,6 +26,9 @@ <xsl:output method="xml" indent="yes"/> + <xsl:variable name="domain-name" select="substring-after(//div[@id='profile-block']/@data-profile-id, '@')"/> + <xsl:variable name="BaseURL" select="concat('https://', $domain-name)"/> + <xsl:variable name="user-name" select="substring-after(//div[@id='profile-block']/@data-profile-id, ':')"/> <xsl:template match="//div[@id='user-content-activities']//ul[@id='major-stream']/li"> @@ -52,6 +55,7 @@ <xsl:template match="/"> <rss version="2.0"> + <xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute> <channel> <generator>Tweeper</generator> <title> diff --git a/rss_converter_twitter.com.xsl b/rss_converter_twitter.com.xsl index 09ba933..3184044 100644 --- a/rss_converter_twitter.com.xsl +++ b/rss_converter_twitter.com.xsl @@ -65,6 +65,7 @@ <xsl:template match="/"> <rss version="2.0"> + <xsl:attribute name="xml:base"><xsl:value-of select="$twitterBaseURL" /></xsl:attribute> <channel> <generator>Tweeper</generator> <title>