added video etc. excplicitly to XSL

This commit is contained in:
vv01f 2017-05-10 04:39:32 +02:00
parent 0ff1d7d15a
commit 92c7143266
2 changed files with 240 additions and 201 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/1999/xhtml"
schemaLocation="xhtml1-strict.xsd"/>
@ -8,8 +8,8 @@
<xs:element name="page">
<xs:complexType>
<xs:choice>
<xs:element ref="news"/>
<xs:group ref="Block.class" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="news"/>
<xs:group ref="Block.class" minOccurs="1" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="title" type="xs:string" use="required"/>
<xs:attribute name="pagetitle" type="xs:string" use="optional"/>
@ -19,8 +19,8 @@
<xs:element name="news">
<xs:complexType>
<xs:sequence>
<xs:element ref="newsfile" minOccurs="1"
maxOccurs="unbounded"/>
<xs:element ref="newsfile" minOccurs="1"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@ -55,8 +55,8 @@
<xs:element name="blockquote">
<xs:complexType>
<xs:sequence>
<xs:group ref="Block.class" minOccurs="0"
maxOccurs="unbounded"/>
<xs:group ref="Block.class" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@ -64,13 +64,13 @@
<xs:element name="resource">
<xs:complexType>
<xs:sequence>
<xs:element ref="alternative" minOccurs="0"
maxOccurs="unbounded"/>
<xs:any namespace="http://podlove.de/simple-chapters"
processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="alternative" minOccurs="0"
maxOccurs="unbounded"/>
<xs:any namespace="http://podlove.de/simple-chapters"
processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="size" type="xs:nonNegativeInteger"
use="required"/>
use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="title" type="xs:string" use="optional"/>
<xs:attribute name="url" type="xs:anyURI" use="required"/>
@ -84,7 +84,7 @@
<xs:complexType>
<xs:attribute name="title" type="xs:string" use="optional"/>
<xs:attribute name="size" type="xs:nonNegativeInteger"
use="required"/>
use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="url" type="xs:anyURI" use="required"/>
</xs:complexType>
@ -104,6 +104,10 @@
<xs:element ref="form" xmlns="http://www.w3.org/1999/xhtml"/>
<xs:element ref="iframe" xmlns="http://www.w3.org/1999/xhtml"/>
<xs:element ref="video" xmlns="http://www.w3.org/1999/xhtml"/>
<xs:element ref="picture"/>
<xs:element ref="image"/>
<xs:element ref="figure"/>
<xs:element ref="figcaption"/>
<xs:element ref="include-frab-schedule"/>
<xs:element ref="resource"/>
</xs:choice>
@ -111,7 +115,7 @@
<xs:complexType name="Block" mixed="true">
<xs:sequence>
<xs:group ref="Inline.class" minOccurs="0"
maxOccurs="unbounded"/>
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="optional"/>
</xs:complexType>
@ -121,7 +125,6 @@
<xs:element ref="link"/>
<xs:element ref="em"/>
<xs:element ref="strong"/>
<xs:element ref="image"/>
<xs:element ref="code"/>
<xs:element ref="sup"/>
</xs:choice>
@ -173,21 +176,30 @@
<xs:element name="code" type="xs:string"/>
<xs:element name="figure">
<xs:choice minOccurs="1">
<xs:element ref="figcaption" maxOccurs="1"/>
<xs:element ref="picture" maxOccurs="1"/>
<xs:element ref="video" maxOccurs="1"/>
</xs:choice>
</xs:element>
<xs:element name="figcaption" type="Block"/>
<xs:element name="sup">
<xs:complexType mixed="true">
<xs:group ref="Inline.class" minOccurs="0"
maxOccurs="unbounded"/>
maxOccurs="unbounded"/>
</xs:complexType>
</xs:element>
<xs:element name="dl">
<xs:complexType>
<xs:sequence>
<xs:element ref="dh" minOccurs="0"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="dt"/>
<xs:element ref="dd"/>
</xs:choice>
<xs:element ref="dh" minOccurs="0"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="dt"/>
<xs:element ref="dd"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="class" type="xs:string" use="optional"/>
</xs:complexType>
@ -206,9 +218,9 @@
<xs:element name="li">
<xs:complexType mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:group ref="Inline.class" minOccurs="0"
maxOccurs="unbounded"/>
<xs:group ref="Block.class" minOccurs="1" maxOccurs="unbounded"/>
<xs:group ref="Inline.class" minOccurs="0"
maxOccurs="unbounded"/>
<xs:group ref="Block.class" minOccurs="1" maxOccurs="unbounded"/>
</xs:choice>
</xs:complexType>
</xs:element>
@ -217,19 +229,19 @@
<xs:simpleType name="dateOrDateTime">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:date"/>
<xs:restriction base="xs:date"/>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:dateTime"/>
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:element name="event">
<xs:complexType>
<xs:sequence>
<xs:element name="start" type="dateOrDateTime"/>
<xs:element name="end" type="dateOrDateTime" minOccurs="0"/>
<xs:element name="location" type="LinkableLocation"
<xs:element name="start" type="dateOrDateTime"/>
<xs:element name="end" type="dateOrDateTime" minOccurs="0"/>
<xs:element name="location" type="LinkableLocation"
minOccurs="0"/>
</xs:sequence>
</xs:complexType>

View File

@ -179,6 +179,23 @@
<blockquote><xsl:call-template name="auto-id"/><xsl:apply-templates/></blockquote>
</xsl:template>
<xsl:template match="source">
<source>
<xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
</source>
</xsl:template>
<xsl:template match="video">
<video>
<xsl:if test="@type='loop'">
<xsl:attribute name="loop"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:attribute name="autoplay">autoplay</xsl:attribute>
<xsl:attribute name="muted">muted</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</video>
</xsl:template>
<!-- Bilder in News-Einträgen haben Pfad immer relativ zu /images/news/ -->
<xsl:template match="image">
<xsl:variable name="path">
@ -198,9 +215,9 @@
<xsl:when test="contains($filename, '.svg') and string-length(substring-after($filename, '.svg'))=0">
<xsl:value-of select="concat($filename, '.png')"/>
</xsl:when>
<xsl:when test="contains(., '://')">
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="contains(., '://')">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$filename"/>
</xsl:otherwise>
@ -208,9 +225,9 @@
</xsl:variable>
<xsl:value-of select="concat(substring-before(string(.),'commons/'),'commons/thumb/',$hash,$filename,'/600px-',$validfilename)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($baseurl, .)"/>
</xsl:otherwise>
<xsl:otherwise>
<xsl:value-of select="concat($baseurl, .)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
@ -226,9 +243,9 @@
<xsl:template match="item/image[1]">
<xsl:variable name="path">
<xsl:call-template name="normalize-path">
<xsl:with-param name="path">
<xsl:value-of select="concat($baseurl, 'images/news/', .)"/>
</xsl:with-param>
<xsl:with-param name="path">
<xsl:value-of select="concat($baseurl, 'images/news/', .)"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
@ -291,6 +308,16 @@
<xsl:apply-templates/>
</sup>
</xsl:template>
<xsl:template match="figure">
<figure>
<xsl:apply-templates/>
</figure>
</xsl:template>
<xsl:template match="figcaption">
<figcaption>
<xsl:apply-templates/>
</figcaption>
</xsl:template>
<xsl:template match="xhtml:*"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
@ -322,13 +349,13 @@
<xsl:template name="navitems">
<xsl:for-each select="document('../content/navigation.xml')/navigation/group">
<ul>
<xsl:for-each select="file">
<xsl:for-each select="file">
<xsl:call-template name="navitem">
<xsl:with-param name="file" select="."/>
<xsl:with-param name="title" select="@title"/>
<xsl:with-param name="baseurl" select="$baseurl"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</ul>
</xsl:for-each>
</xsl:template>
@ -371,42 +398,42 @@
</xsl:variable>
<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>:
<a>
<xsl:if test="string-length($href) &gt; 0">
<xsl:attribute name="href">
<xsl:value-of select="$href"/>
</xsl:attribute>
</xsl:if>
<!-- vv01f:
added link to a specific date in calndar
#eventday-* is to be handeled with css
-->
<xsl:if test="string-length($href) = 0">
<xsl:attribute name="href">
<xsl:value-of select="concat('calendar.html#eventday-',concat(date:month-in-year(start), '-'), date:day-in-month(start))"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="datespan-to-human">
<xsl:with-param name="start" select="start"/>
<xsl:with-param name="end" select="end"/>
</xsl:call-template>:
<a>
<xsl:if test="string-length($href) &gt; 0">
<xsl:attribute name="href">
<xsl:value-of select="$href"/>
</xsl:attribute>
</xsl:if>
<!-- vv01f:
added link to a specific date in calndar
#eventday-* is to be handeled with css
-->
<xsl:if test="string-length($href) = 0">
<xsl:attribute name="href">
<xsl:value-of select="concat('calendar.html#eventday-',concat(date:month-in-year(start), '-'), date:day-in-month(start))"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(location) &gt; 0">
<xsl:attribute name="title">
<xsl:value-of select="concat('Ort: ', location)"/>
<xsl:if test="string-length(date:time(start)) &gt; 0 or string-length(date:time(end)) &gt; 0">
<xsl:value-of select="concat('&#xA;', 'Zeit:')" disable-output-escaping="yes"/>
<xsl:if test="string-length(date:time(start)) &gt; 0 and substring(date:time(start),1,5) != ''">
<xsl:value-of select="concat(' ab ', substring(date:time(start),1,5))"/>
</xsl:if>
<xsl:if test="string-length(date:time(end)) &gt; 0 and substring(date:time(end),1,5) != '' and substring(date:time(end),1,5) != substring(date:time(start),1,5)">
<xsl:value-of select="concat('&#160;bis&#160;', substring(date:time(end),1,5))"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="title"/>
</a>
<xsl:if test="string-length(location) &gt; 0">
<xsl:attribute name="title">
<xsl:value-of select="concat('Ort: ', location)"/>
<xsl:if test="string-length(date:time(start)) &gt; 0 or string-length(date:time(end)) &gt; 0">
<xsl:value-of select="concat('&#xA;', 'Zeit:')" disable-output-escaping="yes"/>
<xsl:if test="string-length(date:time(start)) &gt; 0 and substring(date:time(start),1,5) != ''">
<xsl:value-of select="concat(' ab ', substring(date:time(start),1,5))"/>
</xsl:if>
<xsl:if test="string-length(date:time(end)) &gt; 0 and substring(date:time(end),1,5) != '' and substring(date:time(end),1,5) != substring(date:time(start),1,5)">
<xsl:value-of select="concat('&#160;bis&#160;', substring(date:time(end),1,5))"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="title"/>
</a>
</li>
</xsl:if>
@ -429,41 +456,41 @@
<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: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>
<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>
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">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</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:choose>
<!-- Ends on same day it starts? -->
<xsl:when test="date:date($start) = date:date($end)">
<xsl:call-template name="get-timestring">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</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>
</xsl:template>
@ -480,15 +507,15 @@
<xsl:template match="resource">
<xsl:choose>
<xsl:when test="not(starts-with(@type, 'video/')) or count(resource[not(starts-with(@type, 'video/'))]) &gt; 0">
<!-- Is not only video/* -->
<ul>
<xsl:call-template name="resource-item"/>
<xsl:apply-templates mode="resource"/>
</ul>
<!-- Is not only video/* -->
<ul>
<xsl:call-template name="resource-item"/>
<xsl:apply-templates mode="resource"/>
</ul>
</xsl:when>
<xsl:otherwise>
<!-- Video only -->
<xsl:call-template name="video-resource"/>
<!-- Video only -->
<xsl:call-template name="video-resource"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@ -496,10 +523,10 @@
<xsl:template match="resource/alternative" mode="resource">
<xsl:call-template name="resource-item">
<xsl:with-param name="title">
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="../@title"/></xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="../@title"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
@ -516,14 +543,14 @@
<li class="{name(.)}">
<!-- HTML5 dataset hints for play-resources.js poster -->
<xsl:if test="@poster">
<xsl:attribute name="data-poster">
<xsl:value-of select="@poster"/>
</xsl:attribute>
<xsl:attribute name="data-poster">
<xsl:value-of select="@poster"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@preview">
<xsl:attribute name="data-preview">
<xsl:value-of select="@preview"/>
</xsl:attribute>
<xsl:attribute name="data-preview">
<xsl:value-of select="@preview"/>
</xsl:attribute>
</xsl:if>
<!-- MIME type hinting works even in the browser -->
@ -543,11 +570,11 @@
</span>
<xsl:if test="$baseurl = '' or $baseurl = '../'">
<!-- Include chapters only in XHTML for JS player. ATOM feeds
copy chapters outside <content type="xhtml"/>
-->
<xsl:copy-of select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
<!-- Include chapters only in XHTML for JS player. ATOM feeds
copy chapters outside <content type="xhtml"/>
-->
<xsl:copy-of select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
</xsl:if>
</li>
</xsl:template>
@ -556,24 +583,24 @@
<section class="video-resource">
<h4>
<xsl:call-template name="auto-id"/>
<xsl:choose>
<xsl:when test="@details-link">
<a href="{@details-link}">
<xsl:value-of select="@title"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@title"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@details-link">
<a href="{@details-link}">
<xsl:value-of select="@title"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@title"/>
</xsl:otherwise>
</xsl:choose>
</h4>
<ul>
<xsl:call-template name="video-resource-item"/>
<xsl:apply-templates mode="video-resource"/>
<xsl:call-template name="video-resource-item"/>
<xsl:apply-templates mode="video-resource"/>
<xsl:if test="@feedback-link">
<li class="feedback"><a href="{@feedback-link}">Feedback</a></li>
</xsl:if>
<xsl:if test="@feedback-link">
<li class="feedback"><a href="{@feedback-link}">Feedback</a></li>
</xsl:if>
</ul>
</section>
</xsl:template>
@ -581,10 +608,10 @@
<xsl:template match="resource/alternative" mode="video-resource">
<xsl:call-template name="video-resource-item">
<xsl:with-param name="title">
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="../@title"/></xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="../@title"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
@ -599,35 +626,35 @@
<li class="{name(.)}">
<!-- HTML5 dataset hints for play-resources.js poster -->
<xsl:if test="@poster">
<xsl:attribute name="data-poster">
<xsl:value-of select="@poster"/>
</xsl:attribute>
<xsl:attribute name="data-poster">
<xsl:value-of select="@poster"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@preview">
<xsl:attribute name="data-preview">
<xsl:value-of select="@preview"/>
</xsl:attribute>
<xsl:attribute name="data-preview">
<xsl:value-of select="@preview"/>
</xsl:attribute>
</xsl:if>
<!-- MIME type hinting works even in the browser -->
<a href="{$href}" type="{@type}" class="mime" rel="enclosure">
<xsl:call-template name="mime-for-human-short">
<xsl:with-param name="mime" select="@type"/>
</xsl:call-template>
<xsl:call-template name="mime-for-human-short">
<xsl:with-param name="mime" select="@type"/>
</xsl:call-template>
</a>
<span class="size">
<xsl:call-template name="format-filesize">
<xsl:with-param name="value" select="@size"/>
</xsl:call-template>
<xsl:call-template name="format-filesize">
<xsl:with-param name="value" select="@size"/>
</xsl:call-template>
</span>
<xsl:if test="$baseurl = '' or $baseurl = '../'">
<!-- Include chapters only in XHTML for JS player. ATOM feeds
copy chapters outside <content type="xhtml"/>
-->
<xsl:copy-of select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
<!-- Include chapters only in XHTML for JS player. ATOM feeds
copy chapters outside <content type="xhtml"/>
-->
<xsl:copy-of select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
</xsl:if>
</li>
</xsl:template>
@ -641,11 +668,11 @@
</xsl:when>
<xsl:when test="@title">
<xsl:attribute name="id">
<xsl:call-template name="string-to-lower">
<xsl:with-param name="string" select="@title"/>
<xsl:with-param name="forspace">-</xsl:with-param>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="string-to-lower">
<xsl:with-param name="string" select="@title"/>
<xsl:with-param name="forspace">-</xsl:with-param>
</xsl:call-template>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
@ -656,19 +683,19 @@
<xsl:choose>
<xsl:when test="$value &gt; 1024 * 1024 * 1024">
<xsl:value-of select="format-number($value div (1024 * 1024 * 1024), '0.0')"/>
<xsl:text> GB</xsl:text>
<xsl:text> GiB</xsl:text>
</xsl:when>
<xsl:when test="$value &gt; 1024 * 1024">
<xsl:value-of select="format-number($value div (1024 * 1024), '0.0')"/>
<xsl:text> MB</xsl:text>
<xsl:text> MiB</xsl:text>
</xsl:when>
<xsl:when test="$value &gt; 1024">
<xsl:value-of select="format-number($value div (1024), '0.0')"/>
<xsl:text> KB</xsl:text>
<xsl:text> KiB</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
<xsl:text> Bytes</xsl:text>
<xsl:text> Byte</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@ -733,30 +760,30 @@
<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: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>
<!-- just a filename with no / -->
<xsl:value-of select="$path"/>
<!-- 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>
@ -765,8 +792,8 @@
<xsl:param name="newsfile"/>
<xsl:if test="starts-with($newsfile, 'content/news/pentaradio24-') or
starts-with($newsfile, 'content/news/pentacast-') or
starts-with($newsfile, 'content/news/pentamusic-')">
starts-with($newsfile, 'content/news/pentacast-') or
starts-with($newsfile, 'content/news/pentamusic-')">
<xsl:text>https://flattr.com/submit/auto?user_id=coloradio&amp;url=</xsl:text>
<xsl:value-of select="str:encode-uri(concat($baseurl, substring-before(substring-after($newsfile, 'content/'), '.xml'), '.html'), true())"/>
<xsl:text>&amp;title=</xsl:text>
@ -777,10 +804,10 @@
</xsl:if>
</xsl:template>
<xsl:template name="string-to-lower">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string, ' ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ', concat($forspace,'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'))"/>
</xsl:template>
<xsl:template name="string-to-lower">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string, ' ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ', concat($forspace,'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'))"/>
</xsl:template>
</xsl:stylesheet>