You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
16 years ago
|
<?xml version='1.0'?>
|
||
|
|
||
|
<xsl:stylesheet version="2.0"
|
||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||
|
xmlns:csc="http://www.csclub.uwaterloo.ca/xslt">
|
||
|
|
||
|
<xsl:function name="csc:term" as="xs:string">
|
||
|
<xsl:param name="date" />
|
||
|
<xsl:variable name="date_year" as="xs:integer">
|
||
|
<xsl:analyze-string select="$date" regex="([0-9]+)-[0-9]+-[0-9]+">
|
||
|
<xsl:matching-substring>
|
||
|
<xsl:value-of select="regex-group(1)" />
|
||
|
</xsl:matching-substring>
|
||
|
</xsl:analyze-string>
|
||
|
</xsl:variable>
|
||
|
<xsl:variable name="date_month" as="xs:integer">
|
||
|
<xsl:analyze-string select="$date" regex="[0-9]+-([0-9]+)-[0-9]+">
|
||
|
<xsl:matching-substring>
|
||
|
<xsl:value-of select="regex-group(1)" />
|
||
|
</xsl:matching-substring>
|
||
|
</xsl:analyze-string>
|
||
|
</xsl:variable>
|
||
|
<xsl:variable name="term_text">
|
||
|
<xsl:choose>
|
||
|
<xsl:when test="$date_month ge 1 and $date_month le 4">Winter </xsl:when>
|
||
|
<xsl:when test="$date_month ge 5 and $date_month le 8">Spring </xsl:when>
|
||
|
<xsl:when test="$date_month ge 9 and $date_month le 12">Fall </xsl:when>
|
||
|
</xsl:choose>
|
||
|
</xsl:variable>
|
||
|
<xsl:value-of select="concat($term_text, $date_year)" />
|
||
|
</xsl:function>
|
||
|
|
||
|
</xsl:stylesheet>
|