Mercurial > hg > digilib-old
view client/digitallibrary/jquery/img/embedded_icons.xsl @ 761:16778bd2de7c jquery
added setScaleMode. no compensation for change in scaling yet.
author | robcast |
---|---|
date | Wed, 09 Feb 2011 10:22:29 +0100 |
parents | 2294e91613e6 |
children |
line wrap: on
line source
<?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>