summaryrefslogtreecommitdiff
path: root/xsl/common.xsl
blob: dbc51742492c04246ebe4f6e921e8e3e21255d21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0"
  exclude-result-prefixes="s"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="https://beratung-franzke.de/web-tpl"
  xmlns:html="http://www.w3.org/1999/xhtml">

  <xsl:include href="navi.xsl" />
  <xsl:include href="link.xsl" />
  <xsl:include href="svg.xsl" />
  <xsl:include href="img.xsl" />

  <xsl:strip-space elements="*"/>

  <xsl:variable name="filename" select="/s:html/@name" />
  <xsl:variable name="title" select="document('../main.xml')/s:site/s:page[@filename = $filename]/@title" />
  <xsl:param name="suffix" select="'.xml'" />
  <xsl:param name="stylesheet" select="'@import url(&quot;style.css&quot;);'" />
  <xsl:param name="version" select="''" />

  <xsl:param name="versioned_jpg" select="'.jpg'" />
  <xsl:param name="versioned_png" select="'.png'" />

  <xsl:output method="xml" indent="no" encoding="utf-8"
    cdata-section-elements="script style"
    media-type="application/xhtml+xml"
    doctype-system="about:legacy-compat"
  />

  <xsl:template match="text()" mode="html">
    <!-- Add leading whitespace, if needed -->
    <xsl:if test="not(substring(., 1, 1) = normalize-space(substring(., 1, 1)))"><xsl:text> </xsl:text></xsl:if>
    <xsl:value-of select="normalize-space(.)"/>
    <!-- Add trailing whitespace, if needed -->
    <xsl:if test="not(substring(., string-length(.), 1) = normalize-space(substring(., string-length(.), 1)))"><xsl:text> </xsl:text></xsl:if>
  </xsl:template>

  <xsl:template match="html:*" mode="html">
    <xsl:copy>
    <!--<xsl:element name="{local-name()}">-->
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates mode="html"/>
    <!--</xsl:element>-->
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>