old-website/xsl/atom.xsl

61 lines
2.5 KiB
XML
Raw Normal View History

2007-09-21 21:02:46 -04:00
<?xml version='1.0'?>
<xsl:stylesheet version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:csc="http://csclub.uwaterloo.ca/xslt">
<xsl:param name="g_datetime" required="yes" />
2007-09-21 21:02:46 -04:00
<xsl:template match="//eventdefs">
<xsl:call-template name="atom">
<xsl:with-param name="title">Events</xsl:with-param>
2007-09-29 22:12:03 -04:00
<xsl:with-param name="feedfile">events.atom</xsl:with-param>
<xsl:with-param name="uuid">006f667f-ecae-483a-8cbc-f0c5084dccb1</xsl:with-param>
</xsl:call-template>
2007-09-21 21:02:46 -04:00
</xsl:template>
<xsl:template match="//newsdefs">
<xsl:call-template name="atom">
<xsl:with-param name="title">News</xsl:with-param>
2007-09-29 22:12:03 -04:00
<xsl:with-param name="feedfile">news.atom</xsl:with-param>
<xsl:with-param name="uuid">bdae3752-0cb7-4932-b176-019076389b54</xsl:with-param>
</xsl:call-template>
2007-09-21 21:02:46 -04:00
</xsl:template>
<xsl:template name="atom">
<xsl:param name="title"/>
2007-09-29 22:12:03 -04:00
<xsl:param name="feedfile"/>
<xsl:param name="uuid"/>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>UW Computer Science Club <xsl:value-of select="$title"/></title>
2007-09-29 22:12:03 -04:00
<link href="http://csclub.uwaterloo.ca/{$feedfile}" rel="self"/>
<link href="http://csclub.uwaterloo.ca/"/>
2007-10-06 16:24:05 -04:00
<updated><xsl:value-of select="$g_datetime"/></updated>
<id>urn:uuid:<xsl:value-of select="$uuid"/></id>
<author>
<name>University of Waterloo Computer Science Club</name>
</author>
<xsl:for-each select="newsitem">
<entry>
<link href="http://csclub.uwaterloo.ca"/>
<summary><xsl:value-of select="."/></summary>
<author><name><xsl:value-of select="@author"/></name></author>
</entry>
</xsl:for-each>
2007-09-25 01:00:01 -04:00
<xsl:for-each select="eventitem">
<entry>
<title><xsl:value-of select="@title"/></title>
<!-- we do a hack here with the translate to get whitespace replacement -->
<link href="{concat('http://csclub.uwaterloo.ca/events/',translate(@room,' ','_'),'-',translate(@date,' ','_'),'-',translate(@time,' ','_'),'.html')}"/>
<author><xsl:value-of select="short"/></author>
<summary><xsl:value-of select="abstract"/></summary>
</entry>
</xsl:for-each>
</feed>
2007-09-21 21:02:46 -04:00
</xsl:template>
2007-09-26 02:39:00 -04:00
</xsl:stylesheet>