]> gitweb.michael.orlitzky.com - charm-bypass.git/blob - svgclean.xsl
svgclean.xsl: update a comment
[charm-bypass.git] / svgclean.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:svg="http://www.w3.org/2000/svg"
4 version="1.0">
5 <xsl:output method="xml" encoding="UTF-8" />
6
7 <!--
8 The first rule replaces a <tspan> directly inside of a <text> with
9 its contents. The "directly" part is important because we actually
10 use tspans in one place, for the origin -> destination. We don't
11 want to clobber THOSE tspans, but we can avoid it by putting them
12 in a group (<g>).
13 -->
14 <xsl:template match="svg:text/svg:tspan">
15 <xsl:value-of select="text()" />
16 </xsl:template>
17
18 <!--
19 Then this rule matches everything, and copies it while applying
20 any relevant templates to its children. Either we'll hit a <tspan>
21 within a <text> and process it, or we'll hit this rule again.
22 -->
23 <xsl:template match="*|@*">
24 <xsl:copy>
25 <xsl:apply-templates select="*|@*" />
26 </xsl:copy>
27 </xsl:template>
28 </xsl:stylesheet>