From 1c17fb1edd46f24311fa2e4ad97be6ff46fd3156 Mon Sep 17 00:00:00 2001
From: Antonio Ospite <ospite@studenti.unina.it>
Date: Sun, 7 Jul 2013 01:22:47 +0200
Subject: [PATCH 1/1] Embed the full HTML content of the tweet in the
 description field

Use CDATA to embed the exact copy of an element; it is neat and we get
click-able links in the feed reader for free.
---
 twitter_user_timeline2rss.xsl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/twitter_user_timeline2rss.xsl b/twitter_user_timeline2rss.xsl
index b70cd07..6d72ceb 100644
--- a/twitter_user_timeline2rss.xsl
+++ b/twitter_user_timeline2rss.xsl
@@ -31,15 +31,12 @@
 
     <xsl:variable name="screen-name" select="//div[@class='profile-card-inner']/@data-screen-name"/>
 
-    <!-- TODO: make URLs hyperlinked (http://www.dpawson.co.uk/xsl/rev2/regex2.html) -->
-    <xsl:template name="tweet" match="//p[@class='js-tweet-text tweet-text']">
-        <xsl:value-of select="$screen-name"/>: <xsl:value-of select=".//p[@class='js-tweet-text tweet-text']"/>
-    </xsl:template>
-
     <xsl:template match="//div[@id='timeline']//ol[@id='stream-items-id']//li[@data-item-type='tweet']">
+        <xsl:variable name="tweet-text" select=".//p[@class='js-tweet-text tweet-text']"/>
         <item>
             <title>
-                <xsl:call-template name="tweet"/>
+                <xsl:value-of select="concat($screen-name, ': ')"/>
+                <xsl:value-of select="$tweet-text"/>
             </title>
             <link>
                 <xsl:value-of select="$twitterBaseURL"/><xsl:value-of select=".//a[@class='details with-icn js-details']/@href"/>
@@ -48,7 +45,10 @@
                 <xsl:value-of select="php:functionString('formatDate', .//small[@class='time']//span/@data-time)"/>
             </pubDate>
             <description>
-                <xsl:call-template name="tweet"/>
+                <xsl:value-of select="concat($screen-name, ': ')"/>
+                <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
+                <xsl:copy-of select="$tweet-text/node()"/>
+                <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
             </description>
         </item>
     </xsl:template>
-- 
2.1.4