Problem transforming xml:
<?xml version="1.0" encoding="UTF-8" ?><request><url><![CDATA[http://www.gmfilms.de/]]></url><sslurl><![CDATA[https://www.gmfilms.de/]]></sslurl><baseurl><![CDATA[http://www.gmfilms.de/]]></baseurl><theme><![CDATA[http://www.gmfilms.de/themes/gmfilms/]]></theme><lib><![CDATA[http://www.gmfilms.de/lib/]]></lib><query><![CDATA[de/search/Die%20Gentrifizierung%20bin%20ich%20--%20Beichte%20eines%20Finsterlings]]></query><lang><![CDATA[de]]></lang><lang><![CDATA[en]]></lang><time><![CDATA[1537515196]]></time><!--showing a result here is deprecated and is now delegated to xslt--></request>

<?xml version="1.0" encoding="UTF-8"?>
	<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:php="http://php.net/xsl"
	xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
	>
	<xsl:output
      encoding="UTF-8"
      indent="yes"
      cdata-section-elements="script"
      doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
      media-type="text/html"
      method="html"
      omit-xml-declaration="yes"
      version="1.0"
   />
	<xsl:variable name="database" select="document(php:function('XML::document','database/index.xml'))//file"/><xsl:variable name="request" select="/request"/><xsl:variable name="film" select="$database//filme/film[                      not(contains(titel,'Willkommen bei GMfilms'))       and not(starts-with(titel,'Test'))       and not(concat(@kino,@dvd,@downloadable,@stream) = '') and           (            ( titel = php:function(                 'rawurldecode_except_slashes',                 string($request/query)               )             ) or              ( starts-with($request/query,'de/Filme/') and               titel = php:function(                 'rawurldecode_except_slashes',                 string(substring-before(substring-after($request/query,'de/Filme/'),'/'))               )             ) or (               starts-with($request/query,'de/Filme/id/') and               @id = substring-after($request/query,'de/Filme/id/')             )            )      ]"/><xsl:template match="/request"><html><xsl:call-template name="default-head"/><xsl:call-template name="default-body"/></html></xsl:template><xsl:template match="/request[not(starts-with(query,'de/')) and not(starts-with(query,'export/'))]"><html><xsl:call-template name="default-head"/><body><xsl:call-template name="default-navbar"/><xsl:choose><xsl:when test="count($film) &gt; 0"><xsl:apply-templates select="$film"/></xsl:when><xsl:otherwise><xsl:value-of select="php:function('header_redirect',concat($request/url,'de/search/',query))"/></xsl:otherwise></xsl:choose><xsl:call-template name="default-footer"/></body></html></xsl:template><xsl:template name="default-head"><xsl:param name="theme" select="/request/theme"/><xsl:param name="style" select="'index'"/><xsl:param name="script" select="'index'"/><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><link rel="shortcut icon" href="{$theme}favicon.ico" type="image/x-icon"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><xsl:if test="count(/request/result/file[substring(@path,string-length(@path)-2,3) = '.md']) = 0"><script type="text/javascript">
            var BASEURL = '<xsl:value-of select="/request/baseurl/text()"/>';
            var THEMEURL = '<xsl:value-of select="$theme"/>';
          </script></xsl:if><xsl:variable name="path" select="document(php:function('XML::document','/'))/folder/file[starts-with(@mimetype,'text/')][1]/@path"/><title><xsl:choose><xsl:when test="count($film) &gt; 0"><xsl:value-of select="$film/titel/text()"/></xsl:when><xsl:when test="contains($request/query,'/search/')">Suche</xsl:when><xsl:otherwise><xsl:value-of select="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title"/></xsl:otherwise></xsl:choose></title><meta name="description" content="{document(php:function('XML::document',document(php:function('XML::document','/'))//file[starts-with(@mimetype,'text/')][1]/@path))//h1/following-sibling::*[1]/text()}"/><link rel="stylesheet" href="{/request/lib}bootstrap-3.3.2/css/bootstrap.min.css"/><link rel="stylesheet" href="{$theme}{$style}.css"/><script type="text/javascript" src="{/request/lib}jquery/jquery-1.11.0.min.js"/><script type="text/javascript" src="{/request/lib}/bootstrap-3.3.2/js/bootstrap.min.js"/><xsl:comment><![CDATA[[if lt IE 9]>
          <script src="]]><xsl:value-of select="/request/lib"/><![CDATA[html5shiv/dist/html5shiv.js"></script>
          <script src="]]><xsl:value-of select="/request/lib"/><![CDATA[respond/dest/respond.min.js"></script>
        <![endif]]]></xsl:comment><script type="text/javascript" src="{$theme}{$script}.js"/></head></xsl:template><xsl:variable name="niceurlclosest"><xsl:choose><xsl:when test="not($request/query = '') and document(php:function('XML::document','/'))//*[@niceurl = $request/query]/file"><xsl:value-of select="document(php:function('XML::document','/'))//*[@niceurl = $request/query]/file/../@niceurl"/></xsl:when><xsl:when test="not($request/query = '') and document(php:function('XML::document','/'))//*[@niceurl = $request/query]//file"><xsl:value-of select="document(php:function('XML::document','/'))//*[@niceurl = $request/query]//file/../@niceurl"/></xsl:when><xsl:otherwise><xsl:value-of select="document(php:function('XML::document','/'))//file[not(../@niceurl = '')]/../@niceurl"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:template name="default-body"><body><xsl:call-template name="default-navbar"/><xsl:choose><xsl:when test="count($film) &gt; 0"><xsl:apply-templates select="$film"/></xsl:when><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query and @title = 'Impressum']"><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query and @title = 'Impressum']/file[@mimetype = 'text/plain']/@path))//file"/></div></div></div></xsl:when><xsl:otherwise><xsl:variable name="featured_search" select="document(php:function('XML::document','de/Liste der aktuellen Filme.md'))//file/h1[contains(text(),'Aktuell')]/following-sibling::ul/li"/><xsl:variable name="featured" select="$database//film[$featured_search/text() = titel]"/><xsl:variable name="today" select="php:function('strftime','%Y%m%d',string($request/time))"/><xsl:variable name="movies_playing_now" select="$database//film[@id = //termine/termin[                 (datum[1] = $today and ( not(datum[2]) or datum[2] = $today))                 or                 (datum[1] &lt;= $today and datum[2] &gt;= $today)               ]/titel/@referenz]"/><xsl:variable name="movies_playing_next" select="$database//film[               @id = //termine/termin[datum[1] &gt; $today]/titel/@referenz and               not(@id = $movies_playing_now/@id)             ]"/><xsl:variable name="movies_playing_past" select="               document(php:function('XML::document',                 'database/index.xml'               ))//film[                 not(@id = $movies_playing_now) and                 not(@id = $movies_playing_next)               ]             "/><xsl:choose><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'alle'"/><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'Kinofilme'"/><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'online'"/><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'DVD'"/><xsl:when test="starts-with($request/query,'de/search/')"/><xsl:when test="starts-with($request/query,'de/Filme/via/')"/><xsl:when test="starts-with($request/query,'de/Filme/mit/')"/><xsl:when test="starts-with($request/query,'de/Filme/als/download/')"/><xsl:when test="starts-with($request/query,'de/Filme/id/')"><xsl:value-of select="php:function('header_redirect',concat($request/url,'de/search/',substring-after($request/query,'de/Filme/id/')))"/></xsl:when><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'aktuell im Kino'"><xsl:call-template name="film-carousel"><xsl:with-param name="list" select="$movies_playing_now/titel"/></xsl:call-template><xsl:call-template name="subnavigation"/></xsl:when><xsl:when test="count($featured) &gt; 0"><xsl:call-template name="film-carousel"><xsl:with-param name="list" select="document(php:function('XML::document','de/Liste der aktuellen Filme.md'))//h2"/></xsl:call-template><xsl:call-template name="subnavigation"/></xsl:when></xsl:choose><xsl:choose><xsl:when test="contains(document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title,'im Kino')"><xsl:if test="count($movies_playing_now) &gt; 0"><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><h2>Aktuell im Kino</h2></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$movies_playing_now" mode="featured"/></xsl:call-template></xsl:if><xsl:if test="count($movies_playing_next) &gt; 0"><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><h2>Demnächst im Kino</h2></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$movies_playing_next" mode="featured"/></xsl:call-template></xsl:if></xsl:when><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'online'"><xsl:variable name="teasers" select="$database//filme/film[                   not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   @*[ not(. = '') and (contains(name(),'download') or contains(name(),'stream')) ]                 ]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="$request/query = 'de/Filme/als/download/'"><xsl:variable name="teasers" select="$database//filme/film[                   not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   @*[ not(. = '') and (contains(name(),'download')) ]                 ]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="$request/query = 'de/Filme/iTunes/'"><xsl:variable name="teasers" select="$database//filme/film[                   not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   @*[ not(. = '') and (contains(name(),'download') or contains(name(),'stream')) and contains(.,'itunes')]                 ]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="starts-with($request/query,'de/search/')"><xsl:variable name="search" select="php:function('strtolower',                     php:function('rawurldecode',substring-after($request/query,'de/search/'))                   )"/><xsl:comment>searching for <xsl:value-of select="$search"/></xsl:comment><xsl:variable name="teasers" select="$database//filme/film[not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and not(concat(@kino,@dvd,@downloadable,@stream) = '') and contains(php:function('strtolower',string(.)),$search)]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><h2><xsl:choose><xsl:when test="count($teasers) = 0">keine<xsl:text> </xsl:text>Suchergebnisse</xsl:when><xsl:when test="count($teasers) = 1">ein<xsl:text> </xsl:text>Suchergebnis</xsl:when><xsl:otherwise><xsl:value-of select="count($teasers)"/><xsl:text> </xsl:text>Suchergebnisse
                        </xsl:otherwise></xsl:choose></h2><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="starts-with($request/query,'de/Filme/via/')"><xsl:variable name="teasers" select="$database//filme/film[                   not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   @*[ not(. = '') and (contains(name(),'download') or contains(name(),'stream')) and contains(.,substring-after($request/query,'de/Filme/via/'))]                 ]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="$request/query = 'de/Filme/mit/Auszeichnung'"><xsl:variable name="teasers" select="$database//film[                   *[contains(text(),'Auszeichnung')] or auszeichnung/@datei                 ]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="starts-with($request/query,'de/Filme/mit/')"><xsl:variable name="teasers" select="$database//*[                   contains(text(),substring-after($request/query,'de/Filme/mit/'))                 ]/ancestor::film"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'DVD'"><xsl:variable name="teasers" select="$database//filme/film[                   not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   @*[ not(. = '') and (                     contains(name(),'dvd')                     ) ]                 ]"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'Kinofilme'"><xsl:variable name="teasers" select="$database//filme/film[                   not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test')) and                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   @kino = 'ja']"/><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[@mimetype = 'text/plain']/@path))//file"/><ul id="abc"/></div></div></div><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title = 'alle'"><div class="container-fluid content-default"><div class="row"><div class="col-sm-12"><h2>Alle Filme</h2></div></div></div><xsl:variable name="teasers" select="$database//filme/film[                   not(concat(@kino,@dvd,@downloadable,@stream) = '') and                   not(contains(titel,'Willkommen bei GMfilms')) and                   not(starts-with(titel,'Test'))                 ]"/><xsl:call-template name="four-teasers-in-a-row"><xsl:with-param name="teasers" select="$teasers" mode="featured"/><xsl:with-param name="limit" select="1000"/></xsl:call-template></xsl:when><xsl:otherwise><div class="container-fluid"><div class="row"><xsl:for-each select="$featured_search"><div class="col-sm-3"><xsl:apply-templates select="$database//film[titel = current()/text()]" mode="teaser"/></div></xsl:for-each></div></div></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose><xsl:call-template name="default-footer"/></body></xsl:template><xsl:template name="four-teasers-in-a-row"><xsl:param name="teasers" select="$database//filme/film[     not(concat(@kino,@dvd,@downloadable,@stream) = '') and     not(contains(titel,'Willkommen bei GMfilms')) and not(starts-with(titel,'Test'))]"/><xsl:param name="limit" select="16"/><div class="container-fluid"><div class="row"><xsl:for-each select="$teasers"><xsl:sort data-type="text" order="ascending" select="php:function('string_prepare_humansort',string(titel))"/><div class="col-sm-3"><xsl:if test="(position() - 1) mod 4 = 0"><xsl:attribute name="id"><xsl:value-of select="substring(php:function('string_prepare_humansort',string(titel)),1,1)"/></xsl:attribute></xsl:if><xsl:apply-templates select="." mode="teaser"/></div></xsl:for-each></div></div></xsl:template><xsl:template match="folder" mode="navigation"><li><xsl:attribute name="class">parent-count-<xsl:value-of select="count(ancestor::folder)"/><xsl:if test="@niceurl = $request/query"> active</xsl:if><xsl:if test=".//folder/@niceurl = $request/query"> opened</xsl:if> children-<xsl:value-of select="count(folder)"/></xsl:attribute><xsl:choose><xsl:when test="count(folder) = 0 or count(ancestor::folder) &gt; 2"><a href="{concat($request/url,@niceurl)}"><xsl:value-of select="@title"/></a></xsl:when><xsl:otherwise><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><xsl:value-of select="@title"/> <span class="caret"/></a><ul class="dropdown-menu" role="menu"><xsl:apply-templates select="folder" mode="navigation"/></ul></xsl:otherwise></xsl:choose></li></xsl:template><xsl:template name="subnavigation"><div class="container-fluid subnavigation"><div class="row"><div class="col-sm-12 left"><ul><xsl:for-each select="document(php:function('XML::document','/'))/folder/folder/folder[@title = 'Filme']/folder"><li><a href="{concat($request/url,@niceurl)}"><xsl:value-of select="@title"/></a></li></xsl:for-each></ul></div></div></div></xsl:template><xsl:template name="default-content"><div class="container-fluid container-content"><xsl:choose><xsl:when test="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[starts-with(@mimetype,'text/')]"><xsl:apply-templates select="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/file[starts-with(@mimetype,'text/')]" mode="hr-to-columns"/></xsl:when><xsl:otherwise><div class="row"><div class="col-sm-12"><h1><xsl:value-of select="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/@title"/></h1><ul><xsl:for-each select="document(php:function('XML::document','/'))//folder[@niceurl = $request/query]/folder"><li><a href="{concat($request/url,@niceurl)}"><xsl:value-of select="@title"/></a></li></xsl:for-each></ul></div></div></xsl:otherwise></xsl:choose></div><xsl:call-template name="sitemap"/></xsl:template><xsl:template match="file[starts-with(@mimetype,'text/')]" mode="hr-to-columns"><xsl:variable name="contents" select="document(php:function('XML::document',@path))//file[1]"/><div class="row hr-to-columns"><xsl:choose><xsl:when test="not($contents/hr)"><div class="col-sm-12"><xsl:apply-templates select="$contents/*"/></div></xsl:when><xsl:otherwise><xsl:for-each select="$contents/hr"><xsl:if test="position() = 1"><div class="col-sm-{floor(12 div (count(../hr) + 1))}"><xsl:apply-templates select="$contents/hr[1]/preceding-sibling::*"/></div></xsl:if><div class="col-sm-{floor(12 div (count(../hr) + 1))}"><xsl:apply-templates select="following-sibling::*[not(name() = 'hr') and count(preceding-sibling::hr) = count(current()/preceding-sibling::hr) + 1]"/></div></xsl:for-each></xsl:otherwise></xsl:choose></div></xsl:template><xsl:template name="sitemap"><div class="row"><div class="col-sm-12" id="sitemap-spacer"><h1>Sitemap</h1></div></div><nav class="navbar navbar-default navbar-sitemap" role="navigation" id="sitemap"><div class="container-fluid"><div class="row"><xsl:for-each select="document(php:function('XML::document','/'))/folder/folder[@title = $request/lang[1]]/folder"><div class="col-sm-{floor(12 div count(../folder))}"><ul class="nav nav-pills nav-stacked"><xsl:apply-templates select="." mode="nav-stacked"/></ul></div></xsl:for-each></div></div></nav></xsl:template><xsl:template match="folder" mode="nav-stacked"><li><a href="{concat($request/url,@niceurl)}"><xsl:value-of select="@title"/></a><xsl:if test="count(folder) &gt; 0"><ul class="nav nav-pills nav-stacked"><xsl:apply-templates select="folder" mode="nav-stacked"/></ul></xsl:if></li></xsl:template><xsl:template name="default-footer"><div id="footer"><div class="container-fluid"><div class="row"><div class="col-sm-12"><xsl:apply-templates select="document(php:function('XML::document',document(php:function('XML::document','/'))/folder/folder/file[@mimetype = 'text/plain']/@path))//file" mode="hr-to-columns"/></div></div></div></div></xsl:template><xsl:template match="file"/><xsl:template match="file[@mimetype='application/pdf']"></xsl:template><xsl:template match="file[@mimetype='text/plain']"><xsl:apply-templates select="*"/></xsl:template><xsl:template match="file[@width and (     substring(@path,string-length(@path)-3,4) = '.flv'    or substring(@path,string-length(@path)-3,4) = '.FLV'    or substring(@path,string-length(@path)-3,4) = '.mp4'    or substring(@path,string-length(@path)-3,4) = '.MP4'    or substring(@path,string-length(@path)-3,4) = '.mov'    or substring(@path,string-length(@path)-3,4) = '.MOV'    or substring(@path,string-length(@path)-3,4) = '.m4v'    or substring(@path,string-length(@path)-3,4) = '.M4V'    or substring(@path,string-length(@path)-3,4) = '.f4v'    or substring(@path,string-length(@path)-3,4) = '.F4V'    or substring(@path,string-length(@path)-3,4) = '.mpg'    or substring(@path,string-length(@path)-3,4) = '.MPG'    )    ]"><div class="flowplayer" data-swf="/controller/lib/flowplayer-5.1.1/flowplayer.swf" data-ratio="0.417"><video><source type="video/mp4" src="/controller/open{@path}"/></video></div></xsl:template><xsl:template mode="lightbox" match="file[(     substring(@path,string-length(@path)-3,4) = '.jpg'    or substring(@path,string-length(@path)-3,4) = '.JPG'    or substring(@path,string-length(@path)-3,4) = '.png'    or substring(@path,string-length(@path)-3,4) = '.PNG'    or substring(@path,string-length(@path)-3,4) = '.gif'    or substring(@path,string-length(@path)-3,4) = '.GIF'    or substring(@path,string-length(@path)-3,4) = '.jpeg'    or substring(@path,string-length(@path)-3,4) = '.JPEG'    )    ]"><a href="{concat($request/url,@path)}&amp;h=600" title="{@title}"><img src="/controller/thumbnailer/?query={@path}&amp;w=640"/></a><div class="caption"><xsl:choose><xsl:when test="contains(@title,'|')"><strong><xsl:value-of select="substring-before(@title,'|')"/></strong><xsl:if test="string-length(normalize-space(substring-after(@title,'|'))) &gt; 0"><strong> | </strong><xsl:value-of select="substring-after(@title,'|')"/></xsl:if></xsl:when><xsl:otherwise><xsl:value-of select="@title"/></xsl:otherwise></xsl:choose></div></xsl:template><xsl:template mode="teaser" match="file[(     substring(@path,string-length(@path)-3,4) = '.jpg'    or substring(@path,string-length(@path)-3,4) = '.JPG'    or substring(@path,string-length(@path)-3,4) = '.png'    or substring(@path,string-length(@path)-3,4) = '.PNG'    or substring(@path,string-length(@path)-3,4) = '.jpeg'    or substring(@path,string-length(@path)-3,4) = '.JPEG'    )    ]"><xsl:variable name="parent" select="document(php:function('XML::document','/'))//file[@path=current()/@path]/../@title"/><xsl:variable name="parentpath" select="document(php:function('XML::document','/'))//file[@path=current()/@path]/../file[contains(@mimetype,'text')]/@path"/><a href="{$parent}"><img src="{concat($request/url,@path)}?w=460&amp;h=640"/><div class="caption"><strong><xsl:value-of select="$parent"/></strong><br/><xsl:value-of select="document(php:function('XML::document',string($parentpath)))//file/*[2]"/></div></a></xsl:template><xsl:template match="file[    @mimetype='image/jpg'   or @mimetype='image/jpeg'   or @mimetype='image/png'   or @mimetype='image/gif'   ]"><xsl:param name="width" select="450"/><xsl:param name="height" select="300"/><xsl:param name="class" select="'img-responsive'"/><xsl:param name="caption" select="@title"/><img class="{$class}"><xsl:attribute name="src"><xsl:value-of select="concat($request/url,@path)"/>?<xsl:choose><xsl:when test="not($width='') and not($width=0) and not($height='') and not($height=0)">&amp;w=<xsl:value-of select="$width"/>&amp;h=<xsl:value-of select="$height"/></xsl:when><xsl:when test="not($width='') and not($width=0)">&amp;w=<xsl:value-of select="$width"/></xsl:when><xsl:when test="not($height='') and not($height=0)">&amp;h=<xsl:value-of select="$height"/></xsl:when><xsl:otherwise>&amp;h=640</xsl:otherwise></xsl:choose></xsl:attribute></img><xsl:if test="not($caption = false())"><div class="img-caption"><xsl:value-of select="$caption"/></div></xsl:if></xsl:template><xsl:template match="*[ancestor::file[@mimetype='text/plain']]"><xsl:element name="{name()}"><xsl:apply-templates select="@*|*|text()"/></xsl:element></xsl:template><xsl:template match="h1[ancestor::file[@mimetype='text/plain']]"><xsl:element name="{name()}"><xsl:attribute name="id"><xsl:value-of select="php:function('xmlstring_to_htmlanchor',string(.))"/></xsl:attribute><a href="#{php:function('xmlstring_to_htmlanchor',string(.))}"><xsl:apply-templates select="@*|*|text()"/></a></xsl:element></xsl:template><xsl:template match="h2[ancestor::file[@mimetype='text/plain']]"><xsl:element name="{name()}"><xsl:attribute name="id"><xsl:value-of select="php:function('xmlstring_to_htmlanchor',string(.))"/></xsl:attribute><a href="#{php:function('xmlstring_to_htmlanchor',string(.))}"><xsl:apply-templates select="@*|*|text()"/></a></xsl:element></xsl:template><xsl:template match="a[@href[   ancestor::file[@mimetype='text/plain']   and starts-with(.,'http://')  ] and text() = @href]"><xsl:element name="{name()}"><xsl:apply-templates select="@*"/><xsl:value-of select="substring-after(text(),'http://')"/></xsl:element></xsl:template><xsl:template match="@*[ancestor::file[@mimetype='text/plain']]"><xsl:attribute name="{name()}"><xsl:choose><xsl:when test="starts-with(.,'/')"><xsl:value-of select="concat(/request/server/name,.)"/></xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose></xsl:attribute></xsl:template><xsl:template match="@src[ancestor::file[@mimetype='text/plain']]"><xsl:param name="width" select="false()"/><xsl:param name="height" select="false()"/><xsl:attribute name="{name()}"><xsl:value-of select="concat($request/url,document(php:function('XML::document','/'))//file[@path = current()/ancestor::file/@path]/../@path)"/><xsl:choose><xsl:when test="not(starts-with(.,'http://'))"><xsl:choose><xsl:when test="contains(.,'&amp;') and not(contains(.,'?'))"><xsl:value-of select="concat(      substring-before(.,'&amp;'),      '?',      substring-after(.,'&amp;')     )"/></xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose><xsl:if test="not($width = false()) and not(contains(.,'width='))"><xsl:choose><xsl:when test="$height = false()">?</xsl:when><xsl:otherwise>&amp;</xsl:otherwise></xsl:choose>width=<xsl:value-of select="$width"/></xsl:if><xsl:if test="not($height = false()) and not(contains(.,'height='))"><xsl:choose><xsl:when test="$width = false()">?</xsl:when><xsl:otherwise>&amp;</xsl:otherwise></xsl:choose>height=<xsl:value-of select="$height"/></xsl:if></xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose></xsl:attribute></xsl:template><xsl:template match="@href[ancestor::file[@mimetype='text/plain'] and (    substring(.,string-length(.)-3,4) = '.pdf' or    substring(.,string-length(.)-3,4) = '.xls' or    substring(.,string-length(.)-3,4) = '.doc' or    substring(.,string-length(.)-3,4) = '.rtf' or    substring(.,string-length(.)-3,4) = '.docx' or    substring(.,string-length(.)-3,4) = '.xlsx'  )]"><xsl:variable name="href" select="."/><xsl:attribute name="{name()}"><xsl:choose><xsl:when test="starts-with(.,'/')"><xsl:value-of select="concat(     '/',     document(php:function('XML::document','/'))//file[@niceurl = substring-after($href,'/')]/@path,     '?download'    )"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(    '/',    document(php:function('XML::document','/'))//file[@path = current()/ancestor::file/@path]/../@path,    .,    '?download'   )"/></xsl:otherwise></xsl:choose></xsl:attribute></xsl:template><xsl:template match="@href[   ancestor::file[@mimetype='text/plain']   and (   substring(.,string-length(.)-3,4) = '.jpg'   or substring(.,string-length(.)-3,4) = '.JPG'   or substring(.,string-length(.)-3,4) = '.png'   or substring(.,string-length(.)-3,4) = '.PNG'   or substring(.,string-length(.)-3,4) = '.gif'   or substring(.,string-length(.)-3,4) = '.GIF'   )  ]"><xsl:attribute name="{name()}"><xsl:value-of select="concat(    '/',    document(php:function('XML::document','/'))//file[@path = current()/ancestor::file/@path]/../@path,    .,    ''       )"/></xsl:attribute></xsl:template><xsl:template match="p[count(*|text()) = 1 and img]"><xsl:apply-templates select="img"/></xsl:template><xsl:template match="p[count(img) &gt; 1 and (   string-length(normalize-space(text())) = 0  )]"><div class="row images"><xsl:for-each select="img"><div class="col-xs-{floor(12 div count(../img))}"><xsl:apply-templates select="."/></div></xsl:for-each></div></xsl:template><xsl:template match="p[count(*|text()) &gt; 1 and count(img) = 1]"><xsl:element name="{name()}"><xsl:attribute name="class">img-inline</xsl:attribute><xsl:apply-templates select="@*|*|text()"/></xsl:element></xsl:template><xsl:template match="p[count(*|text()) &gt; 1 and count(img) = 1 and name(img/following-sibling::*[1]) = 'strong']"><xsl:variable name="thumbwidth"><xsl:choose><xsl:when test="contains(ancestor::file/@title,'Stimmen')">2</xsl:when><xsl:otherwise>3</xsl:otherwise></xsl:choose></xsl:variable><div class="row img-inline"><div class="col-xs-{$thumbwidth}"><xsl:choose><xsl:when test="a"><a href="{a[1]/@href}"><xsl:apply-templates select="img"/></a></xsl:when><xsl:otherwise><xsl:apply-templates select="img"/></xsl:otherwise></xsl:choose></div><div class="col-xs-{12 - $thumbwidth}"><xsl:apply-templates select="*[not(name() = 'img')]|text()"/></div></div></xsl:template><xsl:template match="img[not(@class)]"><xsl:param name="width" select="false()"/><xsl:param name="height" select="false()"/><xsl:element name="{name()}"><xsl:attribute name="class">img-responsive</xsl:attribute><xsl:apply-templates select="@*|*|text()"><xsl:with-param name="width" select="$width"/><xsl:with-param name="height" select="$height"/></xsl:apply-templates></xsl:element><xsl:if test="@title or @alt and string-length(@title|@alt) &gt; 0"><p class="img-caption"><xsl:value-of select="@title|@alt"/></p></xsl:if></xsl:template><xsl:template match="img[not(@class) and ../h1 and ancestor::file[@mimetype='text/plain']]">
		img
	</xsl:template><xsl:template match="text()[ancestor::file[@mimetype='text/plain']]"><xsl:value-of select="."/></xsl:template><xsl:template match="a[ancestor::file[@mimetype='text/plain'] and starts-with(@href,'mailto:')]"><a class="mail" href="{php:function('obfuscatemail',string(@href))}">E-Mail-Adresse anzeigen</a></xsl:template><xsl:template match="a[ancestor::file[@mimetype='text/plain'] and starts-with(@href,'tel:')]"><a class="mail" href="{php:function('obfuscatemail',string(@href))}"><xsl:choose><xsl:when test="contains(.,'Fax')">Faxnummer</xsl:when><xsl:otherwise>Telefonnummer</xsl:otherwise></xsl:choose> anzeigen</a></xsl:template><xsl:template match="form[ancestor::file[@mimetype='text/plain']]"><form><xsl:apply-templates select="@*"/><xsl:attribute name="class">form-horizontal</xsl:attribute><xsl:attribute name="role">form</xsl:attribute><xsl:apply-templates select="*|text()"/></form></xsl:template><xsl:template match="label[ancestor::file[@mimetype='text/plain']]"/><xsl:template match="input[ancestor::file[@mimetype='text/plain'] and not(@type = 'submit')]"><div class="form-group {@class}"><xsl:if test="../label[@for = current()/@id]"><label for="#{@id}" class="col-sm-3 control-label"><xsl:value-of select="../label[@for = current()/@id]"/><xsl:if test="@class = 'valid'"><xsl:text> </xsl:text><span class="glyphicon glyphicon-ok"/></xsl:if><xsl:if test="@class = 'invalid'"><xsl:text> </xsl:text><span class="glyphicon glyphicon-remove"/></xsl:if></label></xsl:if><div class="col-sm-9"><input type="text" id="{@id}" name="{@name}" class="form-control" placeholder="{@title}" value="{@value}"/></div></div></xsl:template><xsl:template match="textarea[ancestor::file[@mimetype='text/plain']]"><div class="form-group {@class}"><xsl:if test="../label[@for = current()/@id]"><label for="#{@id}" class="col-sm-3 control-label"><xsl:value-of select="../label[@for = current()/@id]"/><xsl:if test="@class = 'valid'"><xsl:text> </xsl:text><span class="glyphicon glyphicon-ok"/></xsl:if><xsl:if test="@class = 'invalid'"><xsl:text> </xsl:text><span class="glyphicon glyphicon-remove"/></xsl:if></label></xsl:if><div class="col-sm-9"><textarea id="{@id}" name="{@name}" class="form-control" placeholder="{@title}"><xsl:value-of select="text()"/></textarea></div></div></xsl:template><xsl:template match="input[ancestor::file[@mimetype='text/plain'] and @type = 'submit']"><div class="form-group {@class}"><div class="col-sm-offset-3 col-sm-9"><input type="submit" class="btn btn-default" id="{@id}" name="{@name}" value="{@value}"/></div></div></xsl:template><xsl:template name="default-navbar"><nav class="navbar navbar-default " role="navigation"><div class="container-fluid"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"/><span class="icon-bar"/><span class="icon-bar"/></button><a class="navbar-brand" href="{$request/url}"><xsl:choose><xsl:when test="document(php:function('XML::document','/'))//file[starts-with(@mimetype,'image/') and @title='Logo']"><xsl:apply-templates select="document(php:function('XML::document','/'))//file[starts-with(@mimetype,'image/') and @title='Logo'][1]"><xsl:with-param name="width" select="false()"/><xsl:with-param name="height" select="40"/><xsl:with-param name="caption" select="false()"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:value-of select="document(php:function('XML::document',document(php:function('XML::document','/'))/folder/folder/file[starts-with(@mimetype,'text/')][1]/@path))//h1/text()"/></xsl:otherwise></xsl:choose></a></div><div class="collapse navbar-collapse" id="navigation-collapse"><ul class="nav navbar-nav navbar-left"></ul><xsl:if test="count(document(php:function('XML::document','/'))/folder/folder) &gt; 1"><ul class="nav navbar-nav navbar-right"><xsl:apply-templates select="document(php:function('XML::document','/'))/folder/folder[@title='de']/folder[not(@title = 'Impressum')]" mode="navigation"/><li><a class="mailmenu" href="{php:function('obfuscatemail','mailto:gmfilms@gmfilms.de')}">Kontakt</a></li><li><form class="navbar-form navbar-left" role="search" id="search" action="{concat($request/url,'de/search/')}"><div class="input-group"><span class="input-group-btn"><button class="btn btn-default" type="submit" onclick="search();"><span class="glyphicon glyphicon-search" aria-hidden="true"/></button></span><input name="search" type="text" class="form-control" placeholder="Suchen nach..."/></div></form></li></ul></xsl:if></div></div></nav></xsl:template><xsl:template match="request/uri"/><xsl:template match="request/time"/><xsl:template match="request/method"/><xsl:template match="request/lang"/><xsl:template match="request/server"/><xsl:template match="request/host"/><xsl:template match="request/user_agent"/><xsl:template match="request/accept"/><xsl:template match="request/accept_language"/><xsl:template match="request/accept_encoding"/><xsl:template match="request/accept_charset"/><xsl:template match="request/keep_alive"/><xsl:template match="request/connection"/><xsl:template match="request/referer"/><xsl:template match="request/cache_control"/><xsl:template match="request/pragma"/><xsl:template match="request/*[not(name() = 'result')]"/><xsl:template name="title-to-local-anchor"><xsl:param name="string" select="."/><xsl:value-of select="php:function(    'xmlstring_to_htmlanchor',    string($string)   )"/></xsl:template><xsl:template name="attribute-id"><xsl:attribute name="id"><xsl:call-template name="title-to-local-anchor"/></xsl:attribute></xsl:template><xsl:template name="nice-link"><xsl:param name="path" select="@path"/><xsl:variable name="node" select="document(php:function('XML::document','/'))//*[@path=$path]"/><xsl:for-each select="$node/ancestor::*[@title and @path and name() = 'folder']">/<xsl:value-of select="@title"/></xsl:for-each>/<xsl:value-of select="$node/@title"/></xsl:template><xsl:template name="first-paragraph"><xsl:param name="string"/><xsl:value-of select="normalize-space(substring-before($string,'&#10;&#10;'))"/><xsl:if test="not(contains($string,'&#10;&#10;'))"><xsl:value-of select="$string"/></xsl:if></xsl:template><xsl:template name="nl2br"><xsl:param name="string"/><xsl:value-of select="normalize-space(substring-before($string,'&#10;'))"/><xsl:choose><xsl:when test="contains($string,'&#10;')"><br/><xsl:call-template name="nl2br"><xsl:with-param name="string" select="substring-after($string,'&#10;')"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise></xsl:choose></xsl:template><xsl:template match="file[starts-with(@mimetype,'text/')]" mode="hr-to-columns"><xsl:param name="ignore" select="false()"/><xsl:variable name="contents" select="document(php:function('XML::document',@path))//file[1]"/><xsl:choose><xsl:when test="not($contents/hr)"><div class="row hr-to-columns hr-to-columns-head hr-to-columns-body hr-{name($contents/*[not(name() = 'hr') and starts-with(name(),'h')][1])}"><div class="col-sm-12"><xsl:apply-templates select="$contents/*"/></div></div></xsl:when><xsl:otherwise><xsl:if test="not($ignore = false())"><div class="row hr-to-columns hr-to-columns-head hr-{name($contents/*[not(name() = 'hr') and starts-with(name(),'h')][1])}"><div class="col-sm-12"><xsl:apply-templates select="$contents/*[not(name() = 'hr') and starts-with(name(),'h')][1]"/></div></div></xsl:if><div class="row hr-to-columns hr-to-columns-body hr-{name($contents/*[not(name() = 'hr') and starts-with(name(),'h')][2])}"><xsl:for-each select="$contents/hr"><xsl:if test="position() = 1"><div class="col-md-{floor(12 div (count(../hr) + 1))} col-sm-{floor(12 div (count(../hr) + 1))}"><xsl:apply-templates select="$contents/hr[1]/preceding-sibling::*[                    not(starts-with(name(),'h') and count(preceding-sibling::*) = 0)                   ]"/><xsl:if test="count(preceding-sibling::*) = 0"><xsl:apply-templates select="." mode="column-is-empty-fill-with-images"><xsl:with-param name="index" select="0"/></xsl:apply-templates></xsl:if></div></xsl:if><div class="col-md-{floor(12 div (count(../hr) + 1))}  col-sm-{floor(12 div (count(../hr) + 1))}"><xsl:apply-templates select="following-sibling::*[                  not(name() = 'hr') and count(preceding-sibling::hr) = count(current()/preceding-sibling::hr) + 1                  ]"/><xsl:if test="following-sibling::*[1][name() = 'hr'] or not(following-sibling::*)"><xsl:apply-templates select="." mode="column-is-empty-fill-with-images"/></xsl:if></div></xsl:for-each></div></xsl:otherwise></xsl:choose></xsl:template><xsl:template match="film"><xsl:variable name="filmid" select="@id"/><xsl:apply-templates select="." mode="featured"/><xsl:variable name="now" select="number(php:function('strftime','%Y%m%d',string($request/time)))"/><xsl:variable name="events" select="$database//termin[    titel/@referenz = current()/@id and    datum[2] &gt;= $now    ]"/><xsl:variable name="buying" select="@*[    not(. = '') and    contains(name(),'shop') and    ( contains(name(),'download') or contains(name(),'dvd'))]   "/><xsl:variable name="stream" select="@*[    not(. = '') and    contains(name(),'shop') and    contains(name(),'stream')]   "/><div class="container-fluid subnavigation" id="title"><div class="row"><div class="col-sm-6 left"><ul><xsl:if test="count($events) &gt; 0"><li><a href="#cinema" class="target-show-feedback"><i class="glyphicon glyphicon-facetime-video"/> Kino</a></li></xsl:if><xsl:if test="count($stream) &gt; 0"><li><a href="#streaming" class="target-show-feedback"><i class="glyphicon glyphicon-film"/> Stream</a></li></xsl:if><xsl:if test="count($buying) &gt; 0"><li><a href="#buy" class="target-show-feedback"><i class="glyphicon glyphicon-cd"/> Kaufen</a></li></xsl:if></ul></div><div class="col-sm-6 right"><ul><xsl:if test="count($database//pressestimme[titel/@referenz = current()/@id]) &gt; 0"><li><a href="#press">Pressestimmen</a></li></xsl:if><li><a href="#downloads">Downloads</a></li><xsl:if test="       (@youtube and string-length(normalize-space(@youtube)) &gt; 1)       or       (@vimeo and string-length(normalize-space(@vimeo)) &gt; 1)       "><li><a href="#trailer">Trailer</a></li></xsl:if><li><a href="#synopsis">Inhalt</a></li></ul></div></div></div><div class="container-fluid poster"><div class="row"><div class="col-sm-4"><xsl:apply-templates select="document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Plakat']/file[starts-with(@mimetype,'image/')][1]"><xsl:with-param name="width" select="370"/><xsl:with-param name="height" select="false()"/></xsl:apply-templates></div><div class="col-sm-8"><h1><xsl:attribute name="class"><xsl:for-each select="auszeichnung"><xsl:value-of select="@datei"/></xsl:for-each></xsl:attribute><a href="{concat($request/url,'de/Filme/id/',current()/@id)}"><xsl:value-of select="titel"/></a></h1><dl class="core"><dt class="implicit">Ort</dt><dd><xsl:value-of select="ort"/></dd><dt class="implicit">Jahr</dt><dd><xsl:value-of select="jahr"/></dd></dl><dl class="credits"><xsl:call-template name="configfile-to-definition"><xsl:with-param name="string" select="abspann/text()"/></xsl:call-template><xsl:for-each select="$database//links/link[@id = current()/link/@id and keyword = current()/titel]"><xsl:if test="position() = 1"><dt>Webseite zum Film</dt></xsl:if><dd><a href="{url}"><xsl:value-of select="keyword"/></a><xsl:text> </xsl:text><xsl:value-of select="description"/></dd></xsl:for-each></dl></div></div></div><div class="container-fluid content-default" id="synopsis"><div class="row"><div class="col-sm-12"><h2><a href="#synopsis">Inhalt</a></h2><p class="inhalt"><xsl:call-template name="nl2br"><xsl:with-param name="string" select="inhalt/text()"/></xsl:call-template></p></div></div></div><xsl:if test="(@youtube and string-length(normalize-space(@youtube)) &gt; 1) or (@vimeo and string-length(normalize-space(@vimeo)) &gt; 1)"><div class="container-fluid content-default" id="trailer"><div class="row"><div class="col-sm-12"><h2><a href="#trailer">Trailer</a><xsl:comment><xsl:value-of select="@youtube"/></xsl:comment><xsl:if test="@youtube and string-length(normalize-space(@youtube)) &gt; 1"><a class="trailer-tab youtube-com" href="https://www.youtube.com/embed/{@youtube}?title=0&amp;byline=0&amp;portrait=0"><span>YouTube</span></a></xsl:if><xsl:text> </xsl:text><xsl:if test="@vimeo and string-length(normalize-space(@vimeo)) &gt; 1"><a class="trailer-tab vimeo-com" href="https://player.vimeo.com/video/{@vimeo}"><span>Vimeo</span></a></xsl:if></h2><div class="responsive-video"><iframe width="400" height="225" frameborder="0" webkitAllowFullScreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowFullScreen="allowFullScreen"/></div></div></div></div></xsl:if><div class="container-fluid content-default" id="downloads"><div class="row"><div class="col-sm-12"><h2><a href="#downloads">Downloads</a></h2></div></div><div class="row"><xsl:variable name="current_title"><xsl:value-of select="current()/titel"/></xsl:variable><xsl:if test="     count(document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Downloads']/file) &gt; 0    or count(document(php:function('XML::document','trailer/'))//folder/folder[@title = $current_title]/folder/file) &gt; 0    "><xsl:for-each select="document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Downloads']/file"><div class="col-sm-2"><h3 class="download"><a href="{concat($request/url,@path,'?download')}"><i><xsl:attribute name="class"><xsl:choose><xsl:when test="contains(@title,'Presseheft')">download-bundle</xsl:when><xsl:otherwise>download-info</xsl:otherwise></xsl:choose></xsl:attribute></i><xsl:value-of select="@title"/></a></h3></div></xsl:for-each><xsl:for-each select="document(php:function('XML::document','trailer/'))//folder/folder[@title = $current_title]/folder"><xsl:for-each select="file"><div class="col-sm-2"><h3 class="download"><a href="{concat($request/url,@path)}"><i class="download-trailer"/><xsl:value-of select="../@title"/> (<xsl:value-of select="substring-after(@mimetype,'/')"/>)
								</a></h3></div></xsl:for-each></xsl:for-each></xsl:if></div><xsl:if test="count(document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Bilder']/file[starts-with(@mimetype,'image/')]) &gt; 0"><div class="row" id="download-images"><div class="col-sm-12"><h2><a href="#download-images">Pressebilder</a></h2></div></div><xsl:variable name="images" select="document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Bilder']/file[starts-with(@mimetype,'image/')]"/><div class="row download-images"><xsl:attribute name="id">distribute-horizontal</xsl:attribute><div class="col-sm-2"><xsl:for-each select="$images"><a href="{concat($request/url,@path,'?download')}"><xsl:variable name="width_in_cm" select="format-number(round(number(@width) div 300 * 2.54 * 10) div 10,'##0.0')"/><xsl:variable name="height_in_cm" select="format-number(round(number(@height) div 300 * 2.54 * 10) div 10,'##0.0')"/><xsl:apply-templates select="."><xsl:with-param name="width" select="170"/><xsl:with-param name="height" select="false()"/><xsl:with-param name="caption" select="concat(            @title,            ' (',            $width_in_cm,            ' cm x ',            $height_in_cm,            ' cm @300dpi)'           )"/></xsl:apply-templates></a></xsl:for-each></div><div class="col-sm-2"/><div class="col-sm-2"/><div class="col-sm-2"/><div class="col-sm-2"/><div class="col-sm-2"/></div></xsl:if><div class="row"></div></div><xsl:if test="count($database//pressestimme[titel/@referenz = current()/@id]) &gt; 0"><div class="container-fluid content-default" id="press"><div class="row"><div class="col-sm-12"><h2><a href="#press">Pressestimmen</a></h2><xsl:for-each select="$database//pressestimme[titel/@referenz = current()/@id]"><xsl:sort select="datum" data-type="number" sort="descending"/><dl><dt><xsl:value-of select="zitat"/></dt><dd><xsl:choose><xsl:when test="url"><a href="{url}"><xsl:value-of select="autor"/></a></xsl:when><xsl:otherwise><xsl:value-of select="autor"/></xsl:otherwise></xsl:choose></dd></dl></xsl:for-each></div></div></div></xsl:if><xsl:if test="count($buying) &gt; 0 or count($stream) &gt; 0 or count($events) &gt; 0"><div class="container-fluid content-default" id="available"><div class="row"><xsl:if test="count($buying) &gt; 0"><xsl:variable name="dvd" select="$buying[contains(name(),'dvd')]"/><xsl:variable name="download" select="$buying[contains(name(),'download')]"/><div class="col-sm-4" id="buy"><xsl:if test="count($buying) &gt; 0"><h2><a href="#available"><i class="glyphicon glyphicon-cd"/> zu Kaufen</a></h2></xsl:if><xsl:if test="count($dvd) &gt; 0"><h4>als DVD</h4><xsl:for-each select="$dvd"><xsl:variable name="host" select="substring-before(substring-after(.,'//'),'/')"/><xsl:choose><xsl:when test="$host = 'gmfilms.de'"><a class="goodmovies-de" href="https://www.google.de/search?q={php:function('rawurlencode_except_slashes',string(ancestor::film/titel))}:goodmovies.de&amp;ie=UTF-8&amp;oe=UTF-8&amp;btnI=1"><span>good!movies</span></a><br/></xsl:when><xsl:otherwise><a href="{.}" class="{translate($host,'.','-')}"><span><xsl:value-of select="$host"/></span></a><br/></xsl:otherwise></xsl:choose></xsl:for-each></xsl:if><xsl:if test="count($download) &gt; 0"><h4>als Download</h4><xsl:for-each select="$download"><xsl:variable name="host" select="substring-before(substring-after(.,'//'),'/')"/><xsl:choose><xsl:when test="$host = 'gmfilms.de'"><a href="https://www.google.de/search?q={php:function('rawurlencode_except_slashes',string(ancestor::film/titel))}:goodmovies.de&amp;ie=UTF-8&amp;oe=UTF-8&amp;btnI=1" class="goodmovies"><span>good!movies</span></a><br/></xsl:when><xsl:otherwise><a href="{.}" class="{translate($host,'.','-')}"><span><xsl:value-of select="$host"/></span></a><br/></xsl:otherwise></xsl:choose><xsl:comment>.</xsl:comment></xsl:for-each></xsl:if></div></xsl:if><xsl:if test="count($stream) &gt; 0"><div class="col-sm-4" id="streaming"><h2><a href="available"><i class="glyphicon glyphicon-film"/> als Stream</a></h2><h4>online bei</h4><xsl:for-each select="$stream"><xsl:variable name="host" select="substring-before(substring-after(.,'//'),'/')"/><xsl:choose><xsl:when test="$host = 'gmfilms.de'"><a href="https://www.google.de/search?q={php:function('rawurlencode_except_slashes',string(ancestor::film/titel))}:goodmovies.de&amp;ie=UTF-8&amp;oe=UTF-8&amp;btnI=1" class="goodmovies"><span>good!movies</span></a><br/></xsl:when><xsl:otherwise><a href="{.}" class="{translate($host,'.','-')}"><span><xsl:value-of select="$host"/></span></a><br/></xsl:otherwise></xsl:choose><xsl:comment>.</xsl:comment></xsl:for-each></div></xsl:if><xsl:if test="count($events) &gt; 0"><div class="col-sm-4" id="cinema"><h2><a href="#available"><i class="glyphicon glyphicon-facetime-video"/> im Kino</a></h2><xsl:variable name="locations" select="$events/adresse[      not(substring-before(../preceding-sibling::termin[      titel/@referenz = $filmid and      datum[2] &gt;= $now     ]/adresse,':') = substring-before(translate(text(),'.',':'),':'))     ]"/><xsl:if test="$events[datum[2] = '']"><h4>Kinostart</h4><dl><dd><xsl:for-each select="$events[datum[2] = ''][1]"><xsl:value-of select="concat(       substring(datum[1],7,2),'.',substring(datum[1],5,2),'.',substring(datum[1],1,4)      )"/></xsl:for-each></dd></dl></xsl:if><xsl:for-each select="$locations"><xsl:sort select="." data-type="text" sort="ascending"/><xsl:variable name="locationtest" select="substring-before(translate(.,'.',':'),':')"/><xsl:if test="count(../preceding-sibling::termin[        datum[2] &gt;= $now        and        titel/@referenz = $filmid        and        starts-with(adresse,$locationtest)       ]) = 0"><h4><xsl:value-of select="substring-before(translate(.,'.',':'),':')"/></h4><dl><xsl:for-each select="$events[       substring-before(translate(adresse,'.',':'),':') = substring-before(translate(current(),'.',':'),':')      ]"><xsl:sort select="substring(datum[1],1,8)" data-type="number" sort="ascending"/><xsl:comment><xsl:value-of select="@id"/></xsl:comment><xsl:choose><xsl:when test="$now &gt; datum[1] and (          substring(datum[2],5,4) = 3112         )"><xsl:comment>don't show start and stop date in this case</xsl:comment></xsl:when><xsl:when test="$now &gt; datum[1] and not(substring(datum[2],5,4) = 1231)"><dt>bis <xsl:value-of select="concat(substring(datum[2],7,2),'.',substring(datum[2],5,2),'.',substring(datum[2],1,4))"/></dt></xsl:when><xsl:when test="datum[1] = datum[2]"><dt><xsl:value-of select="concat(substring(datum[1],7,2),'.',substring(datum[1],5,2),'.',substring(datum[1],1,4))"/></dt></xsl:when><xsl:otherwise><dt>ab <xsl:value-of select="concat(substring(datum[1],7,2),'.',substring(datum[1],5,2),'.',substring(datum[1],1,4))"/></dt></xsl:otherwise></xsl:choose><dd><xsl:variable name="location" select="substring-after(translate(adresse,'.',':'),':')"/><xsl:choose><xsl:when test="contains($location,',')"><xsl:value-of select="substring-before($location,',')"/>, <xsl:value-of select="substring-after($location,',')"/><br/></xsl:when><xsl:otherwise><xsl:value-of select="$location"/></xsl:otherwise></xsl:choose><small><xsl:value-of select="bemerkungen"/></small></dd></xsl:for-each></dl></xsl:if></xsl:for-each></div></xsl:if></div></div></xsl:if><div class="container-fluid"><div class="row"><div class="col-sm-12"></div></div></div><xsl:if test="count(link) &gt; 0 and count($database//links/link[@id = current()/link/@id and not(keyword = current()/titel)]) &gt; 0"><div class="container-fluid content-default" id="press"><div class="row"><div class="col-sm-12"><h2>weitere Links</h2><ul class="links"><xsl:for-each select="link[@id]"><xsl:for-each select="$database//links/link[@id = current()/@id]"><li><a href="{url}"><xsl:value-of select="keyword"/></a><xsl:if test="string-length(normalize-space(description)) &gt; 0"><br/><xsl:value-of select="description"/></xsl:if></li></xsl:for-each></xsl:for-each></ul></div></div></div></xsl:if></xsl:template><xsl:template name="configfile-grep"><xsl:param name="string" select="text()"/><xsl:param name="filter" select="false()"/><xsl:param name="class" select="''"/><xsl:if test="string-length(normalize-space(substring-before($string,'&#10;'))) &gt; 0"><xsl:call-template name="configline-grep"><xsl:with-param name="string" select="normalize-space(substring-before($string,'&#10;'))"/><xsl:with-param name="filter" select="$filter"/><xsl:with-param name="class" select="$class"/></xsl:call-template></xsl:if><xsl:choose><xsl:when test="contains($string,'&#10;')"><xsl:call-template name="configfile-grep"><xsl:with-param name="string" select="substring-after($string,'&#10;')"/><xsl:with-param name="filter" select="$filter"/><xsl:with-param name="class" select="$class"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="configline-grep"><xsl:with-param name="string" select="$string"/><xsl:with-param name="filter" select="$filter"/><xsl:with-param name="class" select="$class"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="configline-grep"><xsl:param name="string" select="text()"/><xsl:param name="filter" select="false()"/><xsl:param name="class" select="''"/><xsl:if test="$filter = false() or contains(normalize-space(substring-before($string,':')),$filter)"><span class="{$class}"><xsl:value-of select="normalize-space(substring-before($string,':'))"/></span><span class="{$class}"><xsl:value-of select="normalize-space(substring-after($string,':'))"/></span><br/></xsl:if></xsl:template><xsl:template name="configfile-to-definition"><xsl:param name="string" select="text()"/><xsl:param name="filter" select="false()"/><xsl:param name="class" select="''"/><xsl:if test="string-length(normalize-space(substring-before($string,'&#10;'))) &gt; 0"><xsl:call-template name="configline-to-definition"><xsl:with-param name="string" select="normalize-space(substring-before($string,'&#10;'))"/><xsl:with-param name="filter" select="$filter"/><xsl:with-param name="class" select="$class"/></xsl:call-template></xsl:if><xsl:choose><xsl:when test="contains($string,'&#10;')"><xsl:call-template name="configfile-to-definition"><xsl:with-param name="string" select="substring-after($string,'&#10;')"/><xsl:with-param name="filter" select="$filter"/><xsl:with-param name="class" select="$class"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="configline-to-definition"><xsl:with-param name="string" select="$string"/><xsl:with-param name="filter" select="$filter"/><xsl:with-param name="class" select="$class"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="configline-to-definition"><xsl:param name="string" select="text()"/><xsl:param name="filter" select="false()"/><xsl:param name="class" select="''"/><xsl:if test="$filter = false() or contains(normalize-space(substring-before($string,':')),$filter)"><dt class="{$class}"><xsl:value-of select="normalize-space(substring-before($string,':'))"/></dt><dd class="{$class}"><xsl:value-of select="normalize-space(substring-after($string,':'))"/></dd></xsl:if></xsl:template><xsl:template name="film-carousel"><xsl:param name="list" select="$database//film[position() &lt; 5]/titel"/><xsl:if test="count($list) &gt; 0"><div class="container-fluid banner"><div id="slides" class="carousel"><xsl:for-each select="$list"><xsl:sort select="position()" data-type="number" order="descending"/><xsl:variable name="film" select="$database//film[titel = current()/text()]"/><div id="{generate-id(.)}" class="slide"><div class="landscape loader-black" style="background-image:url('{concat(        $request/url,        document(php:function('XML::document','/'))//folder[@title = $film/titel]/folder[@title = 'Banner']/file[starts-with(@mimetype,'image/')][1]/@path,        '?w=1410&amp;h=600'       )}')"/><div class="slide-caption"><div class="row container-fluid"><div class="col-sm-12"><h1 class="title"><a href="{concat(            $request/url,            php:function('rawurlencode_except_slashes',string($film/titel))            )}#slides"><strong><xsl:value-of select="$film/titel"/></strong></a><br/></h1><p><xsl:value-of select="document(php:function('XML::document','de/Liste der aktuellen Filme.md'))//h2[text() = $film/titel]/following-sibling::p[1]"/><br/><a class="expand" href="{concat(            $request/url,            php:function('rawurlencode_except_slashes',string($film/titel))            )}#slides">mehr lesen</a></p></div></div></div></div></xsl:for-each><div id="slide-control-prev" class="noselect"><i class="glyphicon glyphicon-arrow-left"/></div><div id="slide-control-next" class="noselect"><i class="glyphicon glyphicon-arrow-right"/></div></div><div class="row"><div class="col-sm-12"><div id="slide-caption-current"><xsl:comment>Placeholder, expands as necessary</xsl:comment></div><ul class="slide-navigation"><xsl:for-each select="$list"><xsl:sort select="position()" data-type="number" order="descending"/><li class="landscape"><a href="#{generate-id(.)}"/></li></xsl:for-each></ul></div></div></div></xsl:if></xsl:template><xsl:template match="film" mode="featured"><div class="container-fluid banner"><div id="slides"><xsl:for-each select="document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Banner']/file[starts-with(@mimetype,'image/')]"><xsl:sort select="position()" data-type="number" order="descending"/><div id="{generate-id(.)}" class="slide"><div class="landscape loader-black" style="background-image:url('{concat(        $request/url,        @path,        '?w=1410&amp;h=600'       )}')"/></div></xsl:for-each><div id="slide-control-prev" class="noselect"><i class="glyphicon glyphicon-arrow-left"/></div><div id="slide-control-next" class="noselect"><i class="glyphicon glyphicon-arrow-right"/></div></div><div class="row"><div class="col-sm-12"><h1 class="title"><strong><xsl:value-of select="titel"/></strong><br/><xsl:value-of select="ort"/><xsl:text> </xsl:text><xsl:value-of select="jahr"/><xsl:text> </xsl:text><xsl:call-template name="configfile-grep"><xsl:with-param name="string" select="abspann/text()"/><xsl:with-param name="filter" select="'Regie'"/></xsl:call-template></h1><div class="abstract"><p><xsl:call-template name="first-paragraph"><xsl:with-param name="string" select="inhalt/text()"/></xsl:call-template><br/><a class="expand" href="{concat(         $request/url,         php:function('rawurlencode_except_slashes',string(titel))        )}#title">mehr lesen…</a></p></div><ul class="slide-navigation"><xsl:for-each select="document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Banner']/file[starts-with(@mimetype,'image/')]"><xsl:sort select="position()" data-type="number" order="descending"/><li class="landscape"><a href="#{generate-id(.)}"/></li></xsl:for-each></ul></div></div></div></xsl:template><xsl:template match="film" mode="teaser"><div><xsl:attribute name="class">film teaser <xsl:for-each select="auszeichnung"><xsl:value-of select="@datei"/></xsl:for-each></xsl:attribute><a href="{concat(     $request/url,     php:function('rawurlencode_except_slashes',string(titel))    )}" class="teaser-image"><xsl:for-each select="document(php:function('XML::document','/'))//folder[@title = current()/titel]/folder[@title = 'Banner']/file[starts-with(@mimetype,'image/')][1]"><div id="{generate-id(.)}" class="landscape loader-grey" style="background-image:url('{concat(      $request/url,      @path,      '?width=270&amp;height=144'     )}');"/></xsl:for-each></a><div class="title"><h2><xsl:value-of select="titel"/></h2><dl><dt class="implicit">Ort</dt><dd><xsl:value-of select="ort"/></dd><dt class="implicit">Jahr</dt><dd><xsl:value-of select="jahr"/></dd><xsl:call-template name="configfile-to-definition"><xsl:with-param name="string" select="abspann/text()"/><xsl:with-param name="filter" select="'Regie'"/></xsl:call-template></dl></div><div class="abstract"><p><xsl:copy-of select="inhalt"/></p></div></div><a class="teaser-expand" href="{concat(     $request/url,     php:function('rawurlencode_except_slashes',string(titel))    )}">mehr lesen…</a></xsl:template></xsl:stylesheet>