toidinamais_coole_scheisse ist jetzt trunk

git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@74 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
toidinamai 2005-12-28 19:10:50 +00:00
parent 48dfe6ca5b
commit 18f9de7844
13 changed files with 460 additions and 238 deletions

View File

@ -16,12 +16,14 @@ STYLE_RSS=xsl/rss.xsl
NAVIGATION=content/navigation.xml
# XML-Skeletons
SKELETONS:=$(wildcard content/skel-*.xml)
SKEL=empty
SKEL:=empty
# Zu verwendendes Skeleton
SKELFILE=content/skel-$(SKEL).xml
# Dateinamen der Inhalte:
CONTENT:=$(patsubst content/%.xml, www/%.html, $(filter-out $(NAVIGATION) $(SKELETONS), $(wildcard content/*.xml)))
CLEAN:=$(CONTENT) www/news-rss.xml chaosupdates.rdf
CONTENT=$(PAGES) www/news.html #www/news-rss.xml
PAGES:=$(patsubst content/%.xml, www/%.html, $(filter-out $(NAVIGATION) $(SKELETONS), $(wildcard content/*.xml)))
NEWSITEMS:=$(wildcard content/news/*.xml)
CLEAN:=$(CONTENT) www/news.html www/news-rss.xml chaosupdates.rdf
### Defaults ###
.PHONY: contents clean
@ -30,10 +32,17 @@ CLEAN:=$(CONTENT) www/news-rss.xml chaosupdates.rdf
contents: $(CONTENT)
#www/news-rss.xml
### Regeln für den XSLT-Prozess ###
www/news.html: $(NEWSITEMS) $(STYLE) $(NAVIGATION)
{ echo '<?xml version="1.0" encoding="UTF-8"?>' ; \
echo "<page>"; \
echo " <news>"; \
for item in $^ ; do \
echo " <newsfile>$${item}</newsfile>"; \
done; \
echo " </news>"; \
echo "</page>"; } | $(PROCESSOR) -o $@ $(STYLE) -
www/%.html: content/%.xml $(STYLE) $(NAVIGATION) chaosupdates.rdf
$(PROCESSOR) -o $@ $(STYLE) $<

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<navigation>
<file>news</file>
<file>kontakt</file>
<file>mailingliste</file>
<file>wiki</file>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<page title="News">
<news>
<item title="22C3: Private Investigation is around the corner" date="1131228350" author="Fnordic walker" category="Allgemein">
<p>
<image class="left" title="22C3">http://www.c3d2.de/typo3temp/pics/8de5efab18.png</image>
Der jährlich ausgetragene Chaos Communication Congress beginnt seine Magie auszustreuen. Pflicht!
</p>
</item>
</news>
</page>

7
content/news/22c3.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<item title="22C3: Private Investigation is around the corner" date="2005-11-05T23:05:50" author="Fnordic walker" category="Allgemein">
<p>
<image class="left" title="22C3">http://www.c3d2.de/typo3temp/pics/8de5efab18.png</image>
Der jährlich ausgetragene Chaos Communication Congress beginnt seine Magie auszustreuen. Pflicht!
</p>
</item>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<item title="C3D2-Web ist für Matthias einfach genug" date="2005-12-20T23:05:50" author="BSD-Crew" category="Allgemein">
<p>
<image class="right" title="NetBSD rulez! But FreeBSD is simply better!!!111oneoneoneeleventhousandeleven">http://matthias.bsd-crew.de/pix/1.jpg</image>
Die <link href="http://wiki.bsd-crew.de/index.php/BSD-Crew-Weihnachtsaktion">BSD-Crew Weihnachtsaktion</link> ist beendet. Entscheidet mit, wer der Sieger ist!
</p>
</item>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<item title="Datenspuren Audio-Tracks 05" date="2005-05-30T23:05:50" author="Fnordic walker" category="Allgemein">
<p>
<image class="right" title="Bild einer Datenspur">http://www.c3d2.de/typo3temp/pics/294776b4ed.gif</image>
Alle <link href="http://datenspuren.dresden.ccc.de/">Datenspuren</link> Audio-Mitschnitte endlich zum Download. Per ftp über <link>ftp://ftp.skyhub.de/datenspuren/2005/</link>.
</p>
</item>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<item title="Datenspuren 2006" date="2005-11-13T23:05:50" author="c3d2 himself!!!" category="Allgemein">
<p>
<image class="right" title="Eine Datenspur">http://www.c3d2.de/typo3temp/pics/6def158186.gif</image>
Die Dinge sind nicht besser geworden. Spionierende Mautbrücken, E-Pass, Vorratsdatenspeicherung, ... Grund für den C3D2 wieder zum Symposium <link href="http://datenspuren.c3d2.de/">Datenspuren</link> einzuladen. Datum: 13.-14.05.2006. Cfp kommt bald.
</p>
</item>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<item title="TA: Hacktivismus" date="2005-07-30T23:05:50" author="Fnordic walker" category="Themenabend">
<p>
Wegen des großen Erfolges des Vortrags Hacktivismus im <link href="https://berlin05.ccc.de/blog/">Camp Discordia</link> auf der Berlin05 gibt es diesen am 4. Juli ab 20 Uhr im <link href="http://www.azconni.de/">AZ Conni</link> nochmal, noch besser und mit Euch!
</p>
</item>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<item title="Linux-Info-Tag" date="2005-10-07T00:05:50" nicedate="Donnerstag, 6. Oktober" author="Fnordic walker" category="Allgemein">
<p>
<image class="right" title="Dicker Pinguin">http://www.c3d2.de/uploads/pics/tux_01.png</image>
Am 29. Oktober findet der diesjährige Linux-Info-Tag in Dresden statt. Der c3d2 ist mit einem Stand, Vorträgen und Workshops dabei. CU.
</p>
</item>

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<item title="Mailingliste" date="2005-08-24T00:05:50" author="Fnordic walker" category="Allgemein">
<p>
<image class="left" title="Delivered by mailman">http://www.c3d2.de/typo3temp/pics/9cc3346202.jpg</image>
Achtung! die Mailinglistenadresse hat sich gerade geändert. Bitte nutzt <link href="mailto:c3d2@mail.skyhub.de">c3d2@mail.skyhub.de</link>.
Archive sind auch noch da. Siehe <link href="https://mail.skyhub.de/mailman/listinfo/c3d2">Listeninfo</link>.
</p>
</item>

10
content/news/silc.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<item title="Silc.dresden.ccc.de" date="2005-04-13T05:23:05" author="Fnordic walker" category="Allgemein">
<pre>/connect silc.dresden.ccc.de
nnect -6 silc.dresden.ccc.de
in c3d2</pre>
<p>
<image class="right" title="Secure Internet Live Conferencing">http://www.c3d2.de/typo3temp/pics/aa268d9e62.gif</image>
Dunno what <link href="http://www.silcnet.net/">silc</link> is? Go <link href="http://de.wikipedia.org/wiki/SILC">here</link>.
</p>
</item>

358
xsl/date.xsl Normal file
View File

@ -0,0 +1,358 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rss="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="xsl rss rdf date">
<xsl:template name="isleap">
<xsl:param name="year" />
<xsl:value-of select="$year mod 4 = 0 and ($year mod 100 != 0 or $year mod 400 = 0)" />
</xsl:template>
<xsl:template name="leapdays">
<!-- Berechnet die Schalttage, die bis $year seit 1970 vergangen sind -->
<xsl:param name="year" />
<xsl:variable name="four">
<xsl:value-of select="floor($year div 4)" />
</xsl:variable>
<xsl:variable name="hundred">
<xsl:value-of select="floor($year div 100)" />
</xsl:variable>
<xsl:variable name="fourhundred">
<xsl:value-of select="floor($year div 400)" />
</xsl:variable>
<xsl:value-of select="$four - $hundred + $fourhundred - 477" />
</xsl:template>
<xsl:template name="correct-seconds">
<!-- Berechnet die Sekunden die vergangen wären, wenn es keine Schaltjahre gäbe -->
<xsl:param name="seconds" />
<xsl:variable name="yearguessed">
<xsl:value-of select="floor($seconds div (86400 * 365)) + 1970" />
</xsl:variable>
<xsl:variable name="leapdays">
<xsl:call-template name="leapdays">
<xsl:with-param name="year" select="$yearguessed" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="secondscorrected">
<xsl:value-of select="$seconds - $leapdays * 86400" />
</xsl:variable>
<xsl:variable name="year">
<xsl:value-of select="floor($secondscorrected div (86400 * 365)) + 1970" />
</xsl:variable>
<xsl:variable name="isleap">
<xsl:call-template name="isleap">
<xsl:with-param name="year" select="$year" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="days">
<xsl:value-of select="floor(($secondscorrected div 86400) mod 365) + 1" />
</xsl:variable>
<xsl:choose>
<xsl:when test="$isleap">
<xsl:value-of select="$secondscorrected + 86400" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$secondscorrected" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="get-days">
<xsl:param name="seconds" />
<xsl:variable name="secondscorrected">
<xsl:call-template name="correct-seconds">
<xsl:with-param name="seconds" select="$seconds"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="floor(($secondscorrected mod (365 * 86400)) div 86400) + 1" />
</xsl:template>
<xsl:template name="get-year">
<xsl:param name="seconds" />
<xsl:variable name="secondscorrected">
<xsl:call-template name="correct-seconds">
<xsl:with-param name="seconds" select="$seconds"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="1970 + floor($secondscorrected div (86400 * 365))" />
</xsl:template>
<xsl:template name="get-month">
<xsl:param name="seconds" />
<xsl:variable name="year">
<xsl:call-template name="get-year">
<xsl:with-param name="seconds" select="$seconds"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="isleap">
<xsl:call-template name="isleap">
<xsl:with-param name="year" select="$year" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="febdays">
<xsl:choose>
<xsl:when test="$isleap = 'true'">
<xsl:value-of select="29" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="28" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="days">
<xsl:call-template name="get-days">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$days &lt;= 31">
<xsl:value-of select="1" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays">
<xsl:value-of select="2" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31">
<xsl:value-of select="3" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30">
<xsl:value-of select="4" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31">
<xsl:value-of select="5" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30">
<xsl:value-of select="6" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31">
<xsl:value-of select="7" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31">
<xsl:value-of select="8" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30">
<xsl:value-of select="9" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31">
<xsl:value-of select="10" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30">
<xsl:value-of select="11" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31">
<xsl:value-of select="12" />
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="get-dayofmonth">
<xsl:param name="seconds" />
<xsl:variable name="year">
<xsl:call-template name="get-year">
<xsl:with-param name="seconds" select="$seconds"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="isleap">
<xsl:call-template name="isleap">
<xsl:with-param name="year" select="$year" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="febdays">
<xsl:choose>
<xsl:when test="$isleap = 'true'">
<xsl:value-of select="29" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="28" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="days">
<xsl:call-template name="get-days">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$days &lt;= 31">
<xsl:value-of select="$days" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays">
<xsl:value-of select="$days - 31" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31">
<xsl:value-of select="$days - (31 + $febdays)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30">
<xsl:value-of select="$days - (31 + $febdays + 31)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30 + 31)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30 + 31 + 30)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31">
<xsl:value-of select="$days - 31 + $febdays + 31 + 30 + 31 + 30 + 31" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31)" />
</xsl:when>
<xsl:when test="$days &lt;= 31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31">
<xsl:value-of select="$days - (31 + $febdays + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30)" />
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="get-dayofweek">
<!-- 1 entspricht Montag -->
<xsl:param name="seconds" />
<!-- 1. Januar 1970 war ein Donnerstag -->
<xsl:value-of select="(floor($seconds div 86400) + 3) mod 7 + 1" />
</xsl:template>
<xsl:template name="get-dayofweekstring">
<xsl:param name="seconds" />
<xsl:variable name="dayofweek">
<xsl:call-template name="get-dayofweek">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$dayofweek = 1">Montag</xsl:when>
<xsl:when test="$dayofweek = 2">Dienstag</xsl:when>
<xsl:when test="$dayofweek = 3">Mittwoch</xsl:when>
<xsl:when test="$dayofweek = 4">Donnerstag</xsl:when>
<xsl:when test="$dayofweek = 5">Freitag</xsl:when>
<xsl:when test="$dayofweek = 6">Samstag</xsl:when>
<xsl:when test="$dayofweek = 7">Sonntag</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="get-timestring">
<xsl:param name="seconds" />
<xsl:variable name="hour">
<xsl:value-of select="format-number(floor($seconds mod 86400 div 3600), '00')" />
</xsl:variable>
<xsl:variable name="minute">
<xsl:value-of select="format-number(floor($seconds mod 3600 div 60), '00')" />
</xsl:variable>
<xsl:variable name="second">
<xsl:value-of select="format-number(floor($seconds mod 60), '00')" />
</xsl:variable>
<xsl:value-of select="concat($hour, ':', $minute, ':', $second)" />
</xsl:template>
<xsl:template name="get-monthstring">
<xsl:param name="seconds" />
<xsl:variable name="month">
<xsl:call-template name="get-month">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$month = 1">Januar</xsl:when>
<xsl:when test="$month = 2">Februar</xsl:when>
<xsl:when test="$month = 3">März</xsl:when>
<xsl:when test="$month = 4">April</xsl:when>
<xsl:when test="$month = 5">Mai</xsl:when>
<xsl:when test="$month = 6">Juni</xsl:when>
<xsl:when test="$month = 7">Juli</xsl:when>
<xsl:when test="$month = 8">August</xsl:when>
<xsl:when test="$month = 9">September</xsl:when>
<xsl:when test="$month = 10">Oktober</xsl:when>
<xsl:when test="$month = 11">November</xsl:when>
<xsl:when test="$month = 12">Dezember</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="get-datestring">
<xsl:param name="date" />
<xsl:variable name="seconds">
<xsl:value-of select="date:seconds($date)" />
</xsl:variable>
<xsl:variable name="year">
<xsl:call-template name="get-year">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="monthstring">
<xsl:call-template name="get-monthstring">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="dayofmonth">
<xsl:call-template name="get-dayofmonth">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="dayofweekstring">
<xsl:call-template name="get-dayofweekstring">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="timestring">
<xsl:call-template name="get-timestring">
<xsl:with-param name="seconds" select="$seconds" />
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat($dayofweekstring, ', ', $dayofmonth, '. ', $monthstring, ' ', $year, ' um ', $timestring)" />
</xsl:template>
</xsl:stylesheet>

View File

@ -5,154 +5,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
exclude-result-prefixes="xsl rss rdf">
<!-- Hilfsfunktionen für das Ausrechnen -->
<xsl:template name="get-year">
<!--
Von Astro übersetzt aus Datei time/offtime.c von glibc
#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
#define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
while (days < 0 || days >= (__isleap (y) ? 366 : 365))
{
/* Guess a corrected year, assuming 365 days per year. */
long int yg = y + days / 365 - (days % 365 < 0);
/* Adjust DAYS and Y to match the guessed year. */
days -= ((yg - y) * 365
+ LEAPS_THRU_END_OF (yg - 1)
- LEAPS_THRU_END_OF (y - 1));
y = yg;
}
nach
int y(y, days)
{
if (days < 0 || days >= (__isleap (y) ? 366 : 365))
{
long int yg = y + days / 365 - (days % 365 < 0);
days -= ((yg - y) * 365
+ LEAPS_THRU_END_OF (yg - 1)
- LEAPS_THRU_END_OF (y - 1));
return(y(yg, days));
}
else
return(y);
}
.
Von toidinamai übersetzt nach XSL.
-->
<xsl:param name="year"/>
<xsl:param name="days"/>
<!-- Guess a corrected year, assuming 365 days per year. -->
<xsl:variable name="yearguessed">
<xsl:choose>
<xsl:when test="days mod 365 &lt; 0">
<xsl:value-of select="$year + floor(days div 365) - 1" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$year + floor(days div 365)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--
#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
#define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
-->
<xsl:variable name="leapsyearguessed">
<xsl:variable name="mod1">
<xsl:choose>
<xsl:when test="($yearguessed - 1) mod 4 &lt; 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mod2">
<xsl:choose>
<xsl:when test="($yearguessed - 1) mod 100 &lt; 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mod3">
<xsl:choose>
<xsl:when test="($yearguessed - 1) mod 400 &lt; 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="(floor(($yearguessed - 1) div 4) - $mod1) - (floor(($yearguessed - 1) div 100) - $mod2) + (floor(($yearguessed - 1) div 400) - $mod3)"/>
</xsl:variable>
<xsl:variable name="leapsyear">
<xsl:variable name="mod1">
<xsl:choose>
<xsl:when test="($year - 1) mod 4 &lt; 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mod2">
<xsl:choose>
<xsl:when test="($year - 1) mod 100 &lt; 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mod3">
<xsl:choose>
<xsl:when test="($year - 1) mod 400 &lt; 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="(floor(($year - 1) div 4) - $mod1) - (floor(($year - 1) div 100) - $mod2) + (floor(($year - 1) div 400) - $mod3)"/>
</xsl:variable>
<!-- Adjust DAYS and Y to match the guessed year. -->
<xsl:variable name="daysadjusted">
<xsl:value-of select="(($yearguessed - $year) * 365
+ $leapsyearguessed
- $leapsyear)" />
</xsl:variable>
<xsl:choose>
<xsl:when test="((year) mod 4 = 0 and ((year) mod 100 != 0 or (year) mod 400 = 0))">
<xsl:choose>
<xsl:when test="days &lt; 0 or days >= 366">
<xsl:call-template name="get-year">
<xsl:with-param name="year" select="yearguessed" />
<xsl:with-param name="days" select="daysadjusted" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$year" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="days &lt; 0 or days &gt;= 365">
<xsl:call-template name="get-year">
<xsl:with-param name="year" select="yearguessed" />
<xsl:with-param name="days" select="daysadjusted" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$year" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:include href="date.xsl" />
<xsl:output method="xml"
version="1.0"
@ -343,79 +196,35 @@ Von toidinamai übersetzt nach XSL.
</xsl:element>
</xsl:template>
<xsl:template match="item">
<h3 class="news"><xsl:value-of select="@title"/></h3>
<small class="news_author">
<xsl:value-of select="@author"/>
</small>
<xsl:variable name="datestring">
<xsl:call-template name="get-datestring">
<xsl:with-param name="date" select="@date" />
</xsl:call-template>
</xsl:variable>
<xsl:element name="small">
<xsl:attribute name="class">news_date</xsl:attribute>
<xsl:value-of select="concat(' @ ', $datestring)"/>
</xsl:element>
<div class="news">
<xsl:apply-templates/>
</div>
<hr class="news"/>
</xsl:template>
<xsl:template match="news">
<xsl:for-each select="item">
<h3 class="news"><xsl:value-of select="@title"/></h3>
<small class="news_author">
<xsl:value-of select="@author"/>
</small>
<xsl:for-each select="newsfile">
<xsl:apply-templates select="document(current())/item" />
<!-- Magie: Datum aus Unix-Timestamp noch Deutsch transformieren... -->
<xsl:variable name="date_days">
<xsl:value-of select="floor(@date div 604800)" />
</xsl:variable>
<xsl:variable name="date_dayofweek">
<xsl:value-of select="4 + $date_days mod 7"/>
</xsl:variable>
<xsl:variable name="date_hour">
<xsl:value-of select="format-number(floor(@date mod 86400 div 3600), '00')" />
</xsl:variable>
<xsl:variable name="date_minute">
<xsl:value-of select="format-number(floor(@date mod 3600 div 60), '00')" />
</xsl:variable>
<xsl:variable name="date_second">
<xsl:value-of select="format-number(floor(@date mod 60), '00')" />
</xsl:variable>
<xsl:variable name="date_dayofweekstring">
<xsl:choose>
<xsl:when test="$date_dayofweek = 0">Montag</xsl:when>
<xsl:when test="$date_dayofweek = 1">Dienstag</xsl:when>
<xsl:when test="$date_dayofweek = 2">Mittwoch</xsl:when>
<xsl:when test="$date_dayofweek = 3">Donnerstag</xsl:when>
<xsl:when test="$date_dayofweek = 4">Freitag</xsl:when>
<xsl:when test="$date_dayofweek = 5">Samstag</xsl:when>
<xsl:when test="$date_dayofweek = 6">Sonntag</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="date_dayofmonth">23</xsl:variable>
<xsl:variable name="date_month">11</xsl:variable>
<xsl:variable name="date_monthstring">
<xsl:choose>
<xsl:when test="$date_month = 0">Januar</xsl:when>
<xsl:when test="$date_month = 1">Februar</xsl:when>
<xsl:when test="$date_month = 2">März</xsl:when>
<xsl:when test="$date_month = 3">April</xsl:when>
<xsl:when test="$date_month = 4">Mai</xsl:when>
<xsl:when test="$date_month = 5">Juni</xsl:when>
<xsl:when test="$date_month = 6">Juli</xsl:when>
<xsl:when test="$date_month = 7">August</xsl:when>
<xsl:when test="$date_month = 8">September</xsl:when>
<xsl:when test="$date_month = 9">Oktober</xsl:when>
<xsl:when test="$date_month = 10">November</xsl:when>
<xsl:when test="$date_month = 11">Dezember</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="date_year">
<xsl:call-template name="get-year">
<xsl:with-param name="year" select="1970" />
<xsl:with-param name="days" select="floor(@date div 86400)" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="datestring">
<xsl:value-of select="concat($date_dayofweekstring, ', ', $date_dayofmonth, '. ', $date_monthstring, ' ', $date_year, ' um ', $date_hour, ':', $date_minute, ':', $date_second)" />
</xsl:variable>
<xsl:element name="small">
<xsl:attribute name="class">news_date</xsl:attribute>
<!--
<xsl:attribute name="title"><xsl:value-of select="@date"/></xsl:attribute>
-->
@ <xsl:value-of select="$datestring"/>
</xsl:element>
<div class="news">
<xsl:apply-templates/>
</div>
<hr class="news"/>
</xsl:for-each>
</xsl:template>