summaryrefslogtreecommitdiff
path: root/xsl/img.xsl
blob: e2a9824c4cb458633449b18654e728ef8f08f540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?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:template match="html:img" mode="html">
    <xsl:copy>
      <!-- Copy all attributes and nested nodes -->
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates mode="html"/>

      <!-- ..but modify the src attribute to have a ?git-hash suffix -->
      <xsl:attribute name="src">
        <xsl:value-of select="@src"/>
        <xsl:text>?</xsl:text>
        <xsl:value-of select="$version"/>
      </xsl:attribute>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>