Skip to content

Commit a5da2c2

Browse files
committed
cont
1 parent dc48504 commit a5da2c2

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

stylesheets/rss/atom2html.xsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
</xsl:attribute>
4040
<xsl:value-of select="atom:title/text()"/>
4141
</a>
42+
<xsl:text> (</xsl:text>
43+
<xsl:value-of select="atom:updated/text()"/>
44+
<xsl:text>)</xsl:text>
4245
</dt>
4346
<dd>
4447
<xsl:choose>

stylesheets/rss/rss2atom.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:atom="http://www.w3.org/2005/Atom"
55
xmlns="http://www.w3.org/2005/Atom"
66
xmlns:date="http://exslt.org/dates-and-times"
7-
7+
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
88
exclude-result-prefixes="atom date"
99
version="1.0" >
1010
<xsl:output method="xml"/>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0"?>
2+
<xsl:stylesheet
3+
version="1.0"
4+
xmlns:a="http://www.w3.org/2005/Atom"
5+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6+
xmlns:date="http://exslt.org/dates-and-times"
7+
extension-element-prefixes="date"
8+
>
9+
<!--
10+
11+
Motivation:
12+
transforms twitter status to XSL-FO
13+
Author:
14+
Pierre Lindenbaum PhD
15+
WWW:
16+
http://plindenbaum.blogspot.com
17+
Mail:
18+
plindenbaum@yahoo.fr
19+
Usage:
20+
curl "http://api.twitter.com/1/statuses/show/[status-id].xml" > status.xml
21+
fop -xml status.xml -xsl mysql2fo.xsl -pdf result.pdf
22+
23+
-->
24+
25+
26+
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
27+
28+
<xsl:template match="/">
29+
<a:feed>
30+
<a:title><xsl:apply-templates select="html/head/title"/></a:title>
31+
<a:subtitle><xsl:apply-templates select="html/head/title"/></a:subtitle>
32+
<a:link><xsl:apply-templates select="html/head/link[@rel='canonical']/@href"/></a:link>
33+
<xsl:apply-templates select="//div[@class='content' and div[@class='stream-item-header']]"/>
34+
</a:feed>
35+
</xsl:template>
36+
37+
<xsl:template match="div">
38+
<a:entry>
39+
<xsl:apply-templates select=".//a[@data-conversation-id]"/>
40+
<a:title><xsl:value-of select=".//p"/></a:title>
41+
<a:summary><xsl:value-of select=".//p"/></a:summary>
42+
</a:entry>
43+
</xsl:template>
44+
45+
<xsl:template match="a">
46+
<a:link>https://twitter.com/<xsl:value-of select="@href"/></a:link>
47+
<a:id>https://twitter.com/<xsl:value-of select="@data-conversation-id"/></a:id>
48+
<a:updated><xsl:value-of select="date:add('1970-01-01T00:00:00Z', date:duration(span/@data-time ))"/></a:updated>
49+
</xsl:template>
50+
51+
52+
</xsl:stylesheet>

0 commit comments

Comments
 (0)