This is meant both as a way to get an overview of upcoming FreeBSD related events, and as a way to structure links to pages with information / pictures / etc. from past events. The page automatically determines which events are upcoming and which are past, by comparing the event dates with the current date. Discussed on: -www Inspired by PR: www/53674 Which was submitted by: Josef El-Rayes <j.el-rayes@daemon.li>
102 lines
4 KiB
XML
102 lines
4 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
|
|
|
<!-- Copyright (c) 2003 Simon L. Nielsen <simon@FreeBSD.org>
|
|
All rights reserved.
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions
|
|
are met:
|
|
1. Redistributions of source code must retain the above copyright
|
|
notice, this list of conditions and the following disclaimer.
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
notice, this list of conditions and the following disclaimer in the
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
SUCH DAMAGE.
|
|
|
|
$FreeBSD$
|
|
-->
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
|
|
<!-- Generate a unique anchor for this event. -->
|
|
<xsl:template name="generate-event-anchor">
|
|
<xsl:text>event:</xsl:text>
|
|
<xsl:value-of select="@id"/>
|
|
</xsl:template>
|
|
|
|
<!-- Generic templates: -->
|
|
|
|
<!-- Convert a month number to the corresponding long English name. -->
|
|
<xsl:template name="gen-long-en-month">
|
|
<xsl:param name="nummonth"/>
|
|
<xsl:variable name="month" select="number($nummonth)"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$month=1">January</xsl:when>
|
|
<xsl:when test="$month=2">February</xsl:when>
|
|
<xsl:when test="$month=3">March</xsl:when>
|
|
<xsl:when test="$month=4">April</xsl:when>
|
|
<xsl:when test="$month=5">May</xsl:when>
|
|
<xsl:when test="$month=6">June</xsl:when>
|
|
<xsl:when test="$month=7">July</xsl:when>
|
|
<xsl:when test="$month=8">August</xsl:when>
|
|
<xsl:when test="$month=9">September</xsl:when>
|
|
<xsl:when test="$month=10">October</xsl:when>
|
|
<xsl:when test="$month=11">November</xsl:when>
|
|
<xsl:when test="$month=12">December</xsl:when>
|
|
<xsl:otherwise>Invalid month</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
|
|
<!-- Generate a date interval. -->
|
|
<!-- Sample: 27 November, 2002 - 29 December, 2003 -->
|
|
<xsl:template name="gen-date-interval">
|
|
<xsl:param name="startdate"/>
|
|
<xsl:param name="enddate"/>
|
|
|
|
<xsl:value-of select="startdate/day"/>
|
|
|
|
<xsl:if test="number(startdate/month) != number(enddate/month) or
|
|
number(startdate/day) != number(enddate/day) or
|
|
number(startdate/year) != number(enddate/year)">
|
|
|
|
<xsl:if test="number(startdate/month) != number(enddate/month) or
|
|
number(startdate/year) != number(enddate/year)">
|
|
<xsl:text> </xsl:text>
|
|
<xsl:call-template name="gen-long-en-month">
|
|
<xsl:with-param name="nummonth" select="startdate/month"/>
|
|
</xsl:call-template>
|
|
</xsl:if>
|
|
|
|
<xsl:if test="number(startdate/year) != number(enddate/year)">
|
|
<xsl:text>, </xsl:text>
|
|
<xsl:value-of select="startdate/year"/>
|
|
</xsl:if>
|
|
<xsl:text> - </xsl:text>
|
|
|
|
<xsl:if test="number(startdate/day) != number(enddate/day) or
|
|
number(startdate/month) != number(enddate/month) or
|
|
number(startdate/year) != number(enddate/year)">
|
|
<xsl:value-of select="enddate/day"/>
|
|
</xsl:if>
|
|
</xsl:if>
|
|
|
|
<xsl:text> </xsl:text>
|
|
<xsl:call-template name="gen-long-en-month">
|
|
<xsl:with-param name="nummonth" select="enddate/month"/>
|
|
</xsl:call-template>
|
|
|
|
<xsl:text>, </xsl:text>
|
|
<xsl:value-of select="enddate/year"/>
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|