summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2016-07-04 13:35:08 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2016-07-04 13:35:08 +0200
commit9de55450199a01dc406c52a27b0098ca0520f0a0 (patch)
tree1a6bcffe72f5ab4b0fce72182580d0c172bdd3b2
parent95a04b72821de371b46db6a20d49ce3d0de2d9cc (diff)
downloadmutti-web-9de55450199a01dc406c52a27b0098ca0520f0a0.tar.gz
mutti-web-9de55450199a01dc406c52a27b0098ca0520f0a0.tar.bz2
mutti-web-9de55450199a01dc406c52a27b0098ca0520f0a0.zip
xsl/svg.xsl: Minimize svg attributes
They may include newlines and duplicate spaces for readability. Lets normalize those with normalize-space()
-rw-r--r--xsl/svg.xsl11
1 files changed, 8 insertions, 3 deletions
diff --git a/xsl/svg.xsl b/xsl/svg.xsl
index dd18d72..67b76ef 100644
--- a/xsl/svg.xsl
+++ b/xsl/svg.xsl
@@ -39,10 +39,15 @@
</object>
</xsl:template>
- <xsl:template mode="inline-svg" match="svg:*">
+ <xsl:template mode="inline-svg" match="@*">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="normalize-space(.)"/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <xsl:template mode="inline-svg" match="node()">
<xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="inline-svg"/>
+ <xsl:apply-templates mode="inline-svg" select="@*|node()"/>
</xsl:copy>
</xsl:template>