diff client/src/main/webapp/jquery/img/embedded_icons.xsl @ 892:ba1eb2d821a2 mvnify

rearrange sources to maven directory standard
author robcast
date Tue, 19 Apr 2011 18:44:25 +0200
parents client/digitallibrary/jquery/img/embedded_icons.xsl@2294e91613e6
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/main/webapp/jquery/img/embedded_icons.xsl	Tue Apr 19 18:44:25 2011 +0200
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="2.0"
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+	>
+	
+<!--
+Create icons from a single SVG file.
+In the SVG the icons reside in labelled groups -->
+
+<xsl:output method="xml"/>
+
+<xsl:template match="/">
+    <!-- select all hidden layers -->
+    <xsl:apply-templates select="//svg:g[@style='display:none']" />
+</xsl:template>
+
+<xsl:template match="svg:g">
+    <xsl:variable name="name" select="@inkscape:label"/>
+    <xsl:variable name="file" select="concat('embedded/svg/',$name,'.svg')"/>
+    <xsl:result-document href="{$file}">
+    <svg:svg>
+        <xsl:copy-of select="/svg:svg/@*"/>
+        <xsl:copy-of select="/svg:svg/*[not(@style='display:none')]"/>
+        <svg:g>
+            <xsl:copy-of select="@*"/>
+            <!-- replace the "style" attribute -->
+            <xsl:attribute name="style">display:inline</xsl:attribute>
+            <xsl:copy-of select="*"/>
+        </svg:g>
+    </svg:svg>
+    </xsl:result-document>
+</xsl:template>
+
+
+</xsl:stylesheet>
+