67 lines
2.0 KiB
XML
67 lines
2.0 KiB
XML
<?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>
|
|
<xsl:apply-templates select="newsitem" />
|
|
<xsl:apply-templates select="eventitem" />
|
|
</feed>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="//eventitem">
|
|
<entry>
|
|
<title><xsl:value-of select="//short"/></title>
|
|
<link href="http://csclub.uwaterloo.ca"/>
|
|
<summary><xsl:value-of select="//abstract"/></summary>
|
|
</entry>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="//newsitem">
|
|
<entry>
|
|
<link href="http://csclub.uwaterloo.ca"/>
|
|
<summary><xsl:value-of select="//newsitem"/></summary>
|
|
</entry>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|