old-website/xsl/atom.xsl

65 lines
2.3 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_date" required="yes" />
<xsl:param name="g_time" required="yes" />
<xsl:param name="g_pwd" required="yes" />
<xsl:param name="g_root" required="yes" />
<xsl:template match="//eventdefs">
<xsl:call-template name="atom">
<xsl:with-param name="title">Events</xsl:with-param>
<xsl:with-param name="uuid">006f667f-ecae-483a-8cbc-f0c5084dccb1</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="//newsdefs">
<xsl:call-template name="atom">
<xsl:with-param name="title">News</xsl:with-param>
<xsl:with-param name="uuid">bdae3752-0cb7-4932-b176-019076389b54</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="atom">
<xsl:param name="title"/>
<xsl:param name="uuid"/>
<xsl:result-document method="xml" encoding="UTF-8"
href="{concat($g_root, '/', $title, '.atom')}">
</xsl:result-document>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>UW Computer Science Club <xsl:value-of select="$title"/></title>
<link href="http://csclub.uwaterloo.ca/{$title}.atom" rel="self"/>
<link href="http://csclub.uwaterloo.ca/"/>
<updated><xsl:value-of select="$g_date"/></updated>
<id>
urn:uuid:<xsl:value-of select="$uuid"/>
</id>
<author>
<name>University of Waterloo Computer Science Club</name>
</author>
2007-09-25 01:00:01 -04:00
<xsl:for-each select="newsitem">
<entry>
<link href="http://csclub.uwaterloo.ca"/>
<summary><xsl:value-of select="."/></summary>
<author><xsl:value-of select="@author"/></author>
</entry>
</xsl:for-each>
<xsl:for-each select="eventitem">
<entry>
<title><xsl:value-of select="@title"/></title>
2007-09-25 16:36:18 -04:00
<!-- 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')}"/>
2007-09-25 01:31:38 -04:00
<author><xsl:value-of select="short"/></author>
2007-09-25 01:00:01 -04:00
<summary><xsl:value-of select="abstract"/></summary>
</entry>
</xsl:for-each>
2007-09-21 21:02:46 -04:00
</feed>
</xsl:template>
2007-09-25 16:36:18 -04:00
</xsl:stylesheet>