summaryrefslogtreecommitdiff
path: root/xsl/svg.xsl
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-08-23 16:02:34 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-08-23 16:06:05 +0200
commitf9c9aef63c24188c87dbe4a351b2834e2fc0d282 (patch)
tree2557ec019bb4f2833b86481ccb36ede366946086 /xsl/svg.xsl
downloadmutti-web-f9c9aef63c24188c87dbe4a351b2834e2fc0d282.tar.gz
mutti-web-f9c9aef63c24188c87dbe4a351b2834e2fc0d282.tar.bz2
mutti-web-f9c9aef63c24188c87dbe4a351b2834e2fc0d282.zip
Add initial layout + pages
Diffstat (limited to 'xsl/svg.xsl')
-rw-r--r--xsl/svg.xsl36
1 files changed, 36 insertions, 0 deletions
diff --git a/xsl/svg.xsl b/xsl/svg.xsl
new file mode 100644
index 0000000..2fc8778
--- /dev/null
+++ b/xsl/svg.xsl
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:s="https://beratung-franzke.de/web-tpl">
+
+
+ <xsl:template match="s:svg" mode="html">
+ <xsl:call-template name="svg">
+ <xsl:with-param name="svg-file" select="@src" />
+ <xsl:with-param name="svg-alt" select="@alt" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="svg">
+ <xsl:param name="svg-file" />
+ <xsl:param name="svg-alt" />
+
+ <xsl:variable name="png-file" select="concat(substring-before($svg-file, '.svg'), '.png')" />
+
+ <img src="{$svg-file}" alt="{$svg-alt}" class="svg" />
+
+ <object data="{$svg-file}" type="image/svg+xml" class="svg" style="display: none">
+ <xsl:attribute name="width">
+ <xsl:value-of select="ceiling(document(concat('../', $svg-file))/svg:svg/@width)" />
+ </xsl:attribute>
+ <xsl:attribute name="height">
+ <xsl:value-of select="ceiling(document(concat('../', $svg-file))/svg:svg/@height)" />
+ </xsl:attribute>
+ <param name="src" value="{$svg-file}" />
+ <img src="{$png-file}" alt="{$svg-alt}" />
+ </object>
+ </xsl:template>
+
+</xsl:stylesheet>