2006-01-06 19:51:03 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<xsl:stylesheet version="1.0"
|
2006-08-03 16:26:23 +02:00
|
|
|
xmlns="http://www.w3.org/1999/xhtml"
|
2006-01-06 19:51:03 +01:00
|
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
2011-03-28 19:42:19 +02:00
|
|
|
xmlns:rss="http://purl.org/rss/1.0/"
|
|
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
2006-01-06 19:51:03 +01:00
|
|
|
xmlns:date="http://exslt.org/dates-and-times"
|
2008-04-17 17:29:02 +02:00
|
|
|
xmlns:str="http://exslt.org/strings"
|
2011-03-28 19:42:19 +02:00
|
|
|
exclude-result-prefixes="xsl rss rdf date str">
|
2006-01-06 19:51:03 +01:00
|
|
|
|
|
|
|
<xsl:template match="pre">
|
2006-08-03 16:45:22 +02:00
|
|
|
<pre><xsl:apply-templates/></pre>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="p">
|
2006-07-21 00:36:10 +02:00
|
|
|
<xsl:if test="@title">
|
|
|
|
<h3>
|
|
|
|
<xsl:value-of select="@title"/>
|
|
|
|
</h3>
|
|
|
|
</xsl:if>
|
|
|
|
<p class="{@class}">
|
2006-01-14 20:47:16 +01:00
|
|
|
<xsl:apply-templates/>
|
2006-07-21 00:36:10 +02:00
|
|
|
</p>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="dl">
|
2009-05-09 17:32:25 +02:00
|
|
|
<dl class="{@class}">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</dl>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="dh">
|
|
|
|
<dt class="main"><xsl:apply-templates/></dt>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="dt">
|
2006-08-03 16:45:22 +02:00
|
|
|
<dt><xsl:apply-templates/></dt>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="dd">
|
2006-08-03 16:45:22 +02:00
|
|
|
<dd><xsl:apply-templates/></dd>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
2006-04-09 21:36:13 +02:00
|
|
|
<xsl:template match="ul">
|
2006-08-03 16:45:22 +02:00
|
|
|
<ul><xsl:apply-templates/></ul>
|
2006-04-09 21:36:13 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="ol">
|
2006-08-03 16:45:22 +02:00
|
|
|
<ol><xsl:apply-templates/></ol>
|
2006-04-09 21:36:13 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="li">
|
2006-08-03 16:45:22 +02:00
|
|
|
<li><xsl:apply-templates/></li>
|
2006-04-09 21:36:13 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2006-01-06 19:51:03 +01:00
|
|
|
<xsl:template match="image">
|
2010-11-09 23:14:23 +01:00
|
|
|
<xsl:variable name="path">
|
|
|
|
<xsl:call-template name="normalize-path">
|
|
|
|
<xsl:with-param name="path">
|
|
|
|
<xsl:value-of select="string(.)"/>
|
|
|
|
</xsl:with-param>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
|
2006-08-03 16:45:22 +02:00
|
|
|
<img
|
2010-11-09 23:14:23 +01:00
|
|
|
src="{$path}"
|
2006-10-20 19:17:04 +02:00
|
|
|
title="{@title}"
|
|
|
|
alt="{@title}"
|
|
|
|
class="{@class}"/>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
2011-07-13 22:21:00 +02:00
|
|
|
<!-- Bilder in News-Einträgen haben Pfad immer relativ zu /images/news/ -->
|
|
|
|
<xsl:template match="item/image">
|
|
|
|
<xsl:variable name="path">
|
|
|
|
<xsl:call-template name="normalize-path">
|
|
|
|
<xsl:with-param name="path">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(., '://')">
|
|
|
|
<xsl:value-of select="."/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="concat($baseurl, 'images/news/', .)"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:with-param>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<img
|
|
|
|
src="{$path}"
|
|
|
|
title="{@title}"
|
|
|
|
alt="{@title}"
|
|
|
|
class="{@class}"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-01-06 19:51:03 +01:00
|
|
|
<xsl:template match="link">
|
2006-11-01 00:37:06 +01:00
|
|
|
<xsl:variable name="href">
|
2007-05-18 15:25:53 +02:00
|
|
|
<xsl:call-template name="make-href">
|
|
|
|
<xsl:with-param name="href" select="@href"/>
|
|
|
|
</xsl:call-template>
|
2006-11-01 00:37:06 +01:00
|
|
|
</xsl:variable>
|
2006-08-03 16:45:22 +02:00
|
|
|
|
2006-11-01 00:37:06 +01:00
|
|
|
<a href="{$href}">
|
2009-10-02 23:10:58 +02:00
|
|
|
<xsl:if test="@class">
|
|
|
|
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
|
2006-01-06 19:51:03 +01:00
|
|
|
<xsl:apply-templates/>
|
2006-08-03 16:45:22 +02:00
|
|
|
</a>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
2007-05-18 15:25:53 +02:00
|
|
|
<xsl:template name="make-href">
|
|
|
|
<xsl:param name="href"/>
|
|
|
|
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$href and not(contains($href, ':'))">
|
|
|
|
<xsl:value-of select="concat($baseurl,$href)"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$href">
|
|
|
|
<xsl:value-of select="$href"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="."/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-01-06 19:51:03 +01:00
|
|
|
<xsl:template match="em">
|
2006-08-03 16:45:22 +02:00
|
|
|
<em>
|
2006-01-14 19:59:29 +01:00
|
|
|
<xsl:value-of select="."/>
|
2006-08-03 16:45:22 +02:00
|
|
|
</em>
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
2009-02-01 09:07:22 +01:00
|
|
|
<xsl:template match="xhtml:*"
|
|
|
|
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
|
|
|
<xsl:copy-of select="."/>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-05-24 02:19:45 +02:00
|
|
|
<xsl:template match="addendum">
|
|
|
|
<!--
|
|
|
|
Wenn wir nicht in news/ oder anderem sind, dann
|
|
|
|
zeige nicht vollen Newstext (<addendum/>)
|
|
|
|
-->
|
|
|
|
<xsl:if test="string-length($baseurl) > 0">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-07-04 01:28:48 +02:00
|
|
|
<!-- Resources gehören nicht zum generellen Artikeltext
|
|
|
|
und kommen explizit danach -->
|
|
|
|
<xsl:template match="resource"/>
|
|
|
|
|
2006-01-11 19:12:08 +01:00
|
|
|
<xsl:template name="navitem">
|
|
|
|
<xsl:param name="file"/>
|
2006-05-24 02:19:45 +02:00
|
|
|
<xsl:param name="baseurl"/>
|
2006-07-25 23:24:59 +02:00
|
|
|
<xsl:param name="title"/>
|
2006-01-11 19:12:08 +01:00
|
|
|
<li>
|
2006-07-25 23:24:59 +02:00
|
|
|
<a href="{$baseurl}{$file}.html">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="string-length($title) = 0">
|
|
|
|
<xsl:if test="document(concat('../content/pages/', $file, '.xml'))/page/@pagetitle">
|
|
|
|
<xsl:attribute name="title"><xsl:value-of select="document(concat('../content/pages/', $file, '.xml'))/page/@pagetitle"/></xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
|
|
|
|
<xsl:value-of select="document(concat('../content/pages/', $file, '.xml'))/page/@title"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$title"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</a>
|
2006-01-11 19:12:08 +01:00
|
|
|
</li>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="navitems">
|
|
|
|
<ul>
|
|
|
|
<xsl:for-each select="document('../content/navigation.xml')/navigation/file">
|
|
|
|
<xsl:call-template name="navitem">
|
|
|
|
<xsl:with-param name="file" select="."/>
|
2006-07-25 23:24:59 +02:00
|
|
|
<xsl:with-param name="title" select="@title"/>
|
2006-05-24 02:19:45 +02:00
|
|
|
<xsl:with-param name="baseurl" select="$baseurl"/>
|
2006-01-11 19:12:08 +01:00
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:for-each>
|
|
|
|
</ul>
|
|
|
|
</xsl:template>
|
|
|
|
|
2011-07-14 00:37:41 +02:00
|
|
|
<xsl:template name="adspace">
|
|
|
|
<div id="adspace">
|
2011-09-07 03:09:38 +02:00
|
|
|
<!--h2>Podcast-Portal</h2>
|
2011-07-14 00:37:41 +02:00
|
|
|
<p>
|
|
|
|
<a href="http://pentamedia.org/">
|
|
|
|
<img title="pentamedia.org"
|
|
|
|
alt="pentamedia"
|
2011-09-07 03:09:38 +02:00
|
|
|
src="{concat($baseurl, 'images/pentamedia.png')}"/>
|
|
|
|
</a>
|
|
|
|
</p-->
|
|
|
|
<p>
|
|
|
|
<a href="http://datenspuren.de/">
|
|
|
|
<img title="Datenspuren 2011"
|
|
|
|
alt="Datenspuren 2011"
|
|
|
|
src="{concat($baseurl, 'images/datenspuren2011.png')}"/>
|
2011-07-14 00:37:41 +02:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-01-11 19:12:08 +01:00
|
|
|
<xsl:template name="chaosupdates">
|
2006-12-08 00:26:47 +01:00
|
|
|
<xsl:param name="limit" select="5"/>
|
2010-11-27 19:00:25 +01:00
|
|
|
<div id="news">
|
2006-12-08 00:26:47 +01:00
|
|
|
<h2>
|
2011-03-28 19:42:19 +02:00
|
|
|
<a href="{document('../chaosupdates.xml')/rdf:RDF/rss:channel/rss:link}">
|
|
|
|
<xsl:value-of select="document('../chaosupdates.xml')/rdf:RDF/rss:channel/rss:title"/>
|
2006-12-08 00:26:47 +01:00
|
|
|
</a>
|
|
|
|
</h2>
|
|
|
|
<ul>
|
2011-03-28 19:42:19 +02:00
|
|
|
<xsl:for-each select="document('../chaosupdates.xml')/rdf:RDF/rss:item[position() <= $limit]">
|
2006-12-08 00:26:47 +01:00
|
|
|
<li>
|
2011-03-28 19:42:19 +02:00
|
|
|
<a href="{rss:link}">
|
|
|
|
<xsl:value-of select="rss:title"/>
|
2006-12-08 00:26:47 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</xsl:for-each>
|
|
|
|
</ul>
|
2010-11-27 19:00:25 +01:00
|
|
|
</div> <!-- id="news" -->
|
2006-01-11 19:12:08 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
2006-11-10 02:16:50 +01:00
|
|
|
<xsl:template name="calendar-events">
|
2006-12-08 00:26:47 +01:00
|
|
|
<xsl:param name="limit" select="5"/>
|
2006-11-10 02:16:50 +01:00
|
|
|
<xsl:if test="document('../calendar-summary.xml')/page/calendar-summary/event[date:seconds(end) >= date:seconds(date:date())]">
|
2010-11-27 19:00:25 +01:00
|
|
|
<div id="upcoming">
|
2006-11-10 02:16:50 +01:00
|
|
|
<h2>
|
2007-03-06 18:48:24 +01:00
|
|
|
<a href="{$baseurl}calendar.html">Kalender</a>
|
2006-11-10 02:16:50 +01:00
|
|
|
</h2>
|
|
|
|
<ul>
|
|
|
|
<xsl:for-each select="document('../calendar-summary.xml')/page/calendar-summary/event[date:seconds(end) >= date:seconds(date:date())]">
|
|
|
|
<xsl:sort select="date:seconds(start)" data-type="number" order="ascending" />
|
|
|
|
|
2006-12-08 00:26:47 +01:00
|
|
|
<xsl:if test="position() <= $limit">
|
2007-05-18 15:25:53 +02:00
|
|
|
<xsl:variable name="href">
|
|
|
|
<xsl:call-template name="make-href">
|
|
|
|
<xsl:with-param name="href" select="link"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
|
2006-12-08 00:26:47 +01:00
|
|
|
<li>
|
|
|
|
<xsl:call-template name="datespan-to-human">
|
|
|
|
<xsl:with-param name="start" select="start"/>
|
|
|
|
<xsl:with-param name="end" select="end"/>
|
|
|
|
</xsl:call-template>:
|
2007-05-18 15:25:53 +02:00
|
|
|
<a href="{$href}">
|
2006-12-08 00:26:47 +01:00
|
|
|
<xsl:value-of select="title"/>
|
|
|
|
</a>
|
2009-01-07 22:46:04 +01:00
|
|
|
|
|
|
|
<xsl:if test="location">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<span class="location"><xsl:value-of select="location"/></span>
|
|
|
|
</xsl:if>
|
2006-12-08 00:26:47 +01:00
|
|
|
</li>
|
|
|
|
</xsl:if>
|
2006-11-10 02:16:50 +01:00
|
|
|
</xsl:for-each>
|
|
|
|
</ul>
|
2010-11-27 19:00:25 +01:00
|
|
|
</div>
|
2006-11-10 02:16:50 +01:00
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-07-26 03:36:40 +02:00
|
|
|
<!-- Support für <event/> bzw. Microformats -->
|
|
|
|
<xsl:include href="date.xsl" />
|
2011-09-25 02:56:17 +02:00
|
|
|
<xsl:template match="item/event">
|
|
|
|
<dl>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</dl>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-07-26 03:36:40 +02:00
|
|
|
<xsl:template match="item/event/start">
|
2011-07-22 03:31:29 +02:00
|
|
|
<xsl:variable name="start" select="."/>
|
|
|
|
<xsl:variable name="end" select="../end"/>
|
2011-09-25 02:56:17 +02:00
|
|
|
|
|
|
|
<dt>Datum</dt>
|
|
|
|
<dd>
|
|
|
|
<abbr class="dtstart">
|
|
|
|
<xsl:attribute name="title">
|
|
|
|
<xsl:call-template name="date-to-hevent">
|
|
|
|
<xsl:with-param name="date" select="$start"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:attribute>
|
|
|
|
|
|
|
|
<xsl:call-template name="get-datestring">
|
|
|
|
<xsl:with-param name="date" select="$start"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</abbr>
|
|
|
|
|
|
|
|
<xsl:if test="$end">
|
|
|
|
bis
|
|
|
|
<abbr class="dtend">
|
|
|
|
<xsl:attribute name="title">
|
|
|
|
<xsl:call-template name="date-to-hevent">
|
|
|
|
<xsl:with-param name="date" select="$end"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:attribute>
|
|
|
|
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- Ends on same day it starts? -->
|
|
|
|
<xsl:when test="date:date($start) = date:date($end)">
|
|
|
|
<xsl:call-template name="get-timestring">
|
2011-07-22 03:31:29 +02:00
|
|
|
<xsl:with-param name="date" select="$end"/>
|
|
|
|
</xsl:call-template>
|
2011-09-25 02:56:17 +02:00
|
|
|
</xsl:when>
|
|
|
|
<!-- Event spans days -->
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:call-template name="get-datestring">
|
|
|
|
<xsl:with-param name="date" select="$end"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</abbr>
|
|
|
|
</xsl:if>
|
|
|
|
</dd>
|
2006-07-26 03:36:40 +02:00
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="item/event/end">
|
2011-07-22 03:31:29 +02:00
|
|
|
<!-- Output already for item/event/start above -->
|
2006-07-26 03:36:40 +02:00
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="item/event/location">
|
2011-09-25 02:56:17 +02:00
|
|
|
<dt>Ort</dt>
|
|
|
|
<dd class="location"><xsl:apply-templates/></dd>
|
2006-07-26 03:36:40 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2007-03-14 01:18:05 +01:00
|
|
|
|
|
|
|
<xsl:template name="format-filesize">
|
|
|
|
<xsl:param name="value"/>
|
|
|
|
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$value > 1024 * 1024 * 1024">
|
2007-08-17 06:06:13 +02:00
|
|
|
<xsl:value-of select="format-number($value div (1024 * 1024 * 1024), '0.0')"/>
|
2007-03-14 01:18:05 +01:00
|
|
|
<xsl:text> GB</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$value > 1024 * 1024">
|
2007-08-17 06:06:13 +02:00
|
|
|
<xsl:value-of select="format-number($value div (1024 * 1024), '0.0')"/>
|
2007-03-14 01:18:05 +01:00
|
|
|
<xsl:text> MB</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$value > 1024">
|
2007-08-17 06:06:13 +02:00
|
|
|
<xsl:value-of select="format-number($value div (1024), '0.0')"/>
|
2007-03-14 01:18:05 +01:00
|
|
|
<xsl:text> KB</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$value"/>
|
|
|
|
<xsl:text> Bytes</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2007-04-10 03:36:48 +02:00
|
|
|
<xsl:template name="mime-for-human">
|
|
|
|
<xsl:param name="mime"/>
|
|
|
|
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$mime = 'application/ogg'">Ogg Vorbis</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'audio/mpeg'">MPEG-Audio</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'application/octet-stream'">Binärdatei</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'application/xhtml+xml'">XHTML-Dokument</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'text/html'">HTML-Dokument</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'text/plain'">Text-Dokument</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'application/pdf'">Portable Document Format</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'image/svg+xml'">Scalable Vector Graphics</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'image/gif'">GIF-Bild</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'image/jpeg'">JPEG-Bild</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'image/png'">PNG-Bild</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'video/mpeg'">MPEG-Video</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'video/mp4'">MP4-Video</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'video/quicktime'">QuickTime-Video</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'video/x-ms-wmv'">Windows Media-Video</xsl:when>
|
2008-03-22 02:09:19 +01:00
|
|
|
<xsl:when test="$mime = 'video/x-msvideo'">Video for Windows</xsl:when>
|
2008-05-18 14:55:44 +02:00
|
|
|
<xsl:when test="$mime = 'video/avi'">Audio Video Interleave</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'video/ogg'">Ogg Media Video</xsl:when>
|
2009-09-23 01:17:55 +02:00
|
|
|
<xsl:when test="$mime = 'video/x-matroska'">Matroska Video</xsl:when>
|
2010-10-08 18:09:07 +02:00
|
|
|
<xsl:when test="$mime = 'video/x-m4v'">iTunes Video File</xsl:when>
|
2010-11-10 01:14:50 +01:00
|
|
|
<xsl:when test="$mime = 'video/webm'">WebM Video</xsl:when>
|
2010-11-15 02:43:08 +01:00
|
|
|
<xsl:when test="$mime = 'video/x-flv'">Flash Video</xsl:when>
|
2008-12-06 14:27:32 +01:00
|
|
|
<xsl:when test="$mime = 'application/x-gtar'">Komprimierter Tarball</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'application/x-tar'">Tarball</xsl:when>
|
2009-08-25 18:19:04 +02:00
|
|
|
<xsl:when test="$mime = 'application/x-bittorrent'">BitTorrent-Metainformationen</xsl:when>
|
2010-07-07 01:16:09 +02:00
|
|
|
<xsl:when test="$mime = 'application/zip'">ZIP-Archiv</xsl:when>
|
|
|
|
<xsl:when test="$mime = 'multipart/x-zip'">ZIP-Archiv</xsl:when>
|
2007-04-10 03:36:48 +02:00
|
|
|
<xsl:otherwise>Datei</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2010-11-09 23:14:23 +01:00
|
|
|
<xsl:template name="normalize-path">
|
|
|
|
<xsl:param name="path"/>
|
|
|
|
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($path, '/')">
|
|
|
|
<xsl:variable name="dir1" select="substring-before($path, '/')"/>
|
|
|
|
<xsl:variable name="dir2" select="substring-after($path, '/')"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="starts-with($dir2, '../')">
|
|
|
|
<!-- recurse with xxx/../ removed -->
|
|
|
|
<xsl:call-template name="normalize-path">
|
|
|
|
<xsl:with-param name="path">
|
|
|
|
<xsl:value-of select="substring-after($dir2, '../')"/>
|
|
|
|
</xsl:with-param>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<!-- spit out and recurse with tail -->
|
|
|
|
<xsl:value-of select="$dir1"/><xsl:text>/</xsl:text><xsl:call-template name="normalize-path">
|
|
|
|
<xsl:with-param name="path">
|
|
|
|
<xsl:value-of select="$dir2"/>
|
|
|
|
</xsl:with-param>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<!-- just a filename with no / -->
|
|
|
|
<xsl:value-of select="$path"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-01-06 19:51:03 +01:00
|
|
|
</xsl:stylesheet>
|