2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:svg="http://www.w3.org/2000/svg"
5 <xsl:output method="xml" encoding="UTF-8" />
8 This empty template for the xml:space attribute removes it from
9 any element where it is found. Inkscape adds it automatically, but
10 we don't rely on it, and it's been deprecated for a while:
12 https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xml:space
15 <xsl:template match="@xml:space" />
18 This rule replaces a <tspan> directly inside of a <text> with its
19 contents. The "directly" part is important because we actually use
20 tspans in one place, for the origin -> destination. We don't want
21 to clobber THOSE tspans, but we can avoid it by putting them in a
24 <xsl:template match="svg:text/svg:tspan">
25 <xsl:value-of select="text()" />
29 Then this rule matches everything, and copies it while applying
30 any relevant templates to its children. Either we'll hit a <tspan>
31 within a <text> and process it, or we'll hit this rule again.
33 <xsl:template match="node()|@*">
35 <xsl:apply-templates select="node()|@*" />