110 lines
4.2 KiB
XML
110 lines
4.2 KiB
XML
<?xml version="1.0" encoding="KOI8-R" ?>
|
||
|
||
<!--
|
||
The FreeBSD Russian Documentation Project
|
||
|
||
$FreeBSDru: frdp/www/ru/events/includes.xsl,v 1.1 2004/03/01 18:29:15 andy Exp $
|
||
|
||
Original revision: 1.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"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=2"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=3"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=4"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=5"><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=6"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=7"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=8"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=9"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=10"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=11"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></xsl:when>
|
||
<xsl:when test="$month=12"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></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>
|