Skip to content

Instantly share code, notes, and snippets.

Created January 14, 2011 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/779728 to your computer and use it in GitHub Desktop.
Save anonymous/779728 to your computer and use it in GitHub Desktop.
Simile RDF to RSS Conversion
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is a quick and dirty conversion template to go from RDF (as produced
by a Simile Timeline) to RSS (to be ingested by Dipity). For more information
see http://stefansinclair.name/collaborative-timelines
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output indent="yes"/>
<xsl:template match="/">
<rss version="2.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:a="http://spreadsheets.google.com/feeds/cells/tlMPzo4m2Jg-K9qcCNFcdlA/od6/public/property#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>CMST-706 Collaborative Timeline on Wikileaks</title>
<link>http://stefansinclair.name/collaborative-timelines</link>
<description></description>
<pubDate><xsl:value-of select="format-date(current-date(),'[FNn,*-3], [D] [MNn] [Y] 0:01:01','en', (), ())"/></pubDate>
</channel>
<xsl:for-each select="rdf:RDF/rdf:Description">
<xsl:variable name="date"><xsl:value-of select="a:start"/></xsl:variable>
<item>
<title><xsl:value-of select="a:label"/></title>
<description>
<xsl:if test="a:image!=''">
&lt;img src="<xsl:value-of select="a:image"/>" alt="<xsl:value-of select="a:label"/>" /&gt;
</xsl:if>
<xsl:value-of select="a:description"/>
</description>
<pubDate><xsl:value-of select="format-date(xs:date($date),'[FNn,*-3], [D] [MNn] [Y] 0:01:01', 'en', (), ())"/></pubDate>
<category><xsl:value-of select="eventType"/></category>
<dc:creator><xsl:value-of select="a:initials"/></dc:creator>
</item>
</xsl:for-each>
</rss>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment