svg2xaml.xsl revision 55409b97452fc42cc6fbb542da79ab133ed705b3
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoCopyright (c) 2005-2007 authors:
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoOriginal version: Toine de Greef (a.degreef@chello.nl)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoModified (2010) by Nicolas Dufour (nicoduf@yahoo.fr) (blur support, units
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoconvertion, comments, and some other fixes)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoPermission is hereby granted, free of charge, to any person obtaining a copy
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoof this software and associated documentation files (the "Software"), to deal
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoin the Software without restriction, including without limitation the rights
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoto use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicocopies of the Software, and to permit persons to whom the Software is
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicofurnished to do so, subject to the following conditions:
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoThe above copyright notice and this permission notice shall be included in
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoall copies or substantial portions of the Software.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoTHE SOFTWARE.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoexclude-result-prefixes="rdf xlink xs exsl libxslt">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:param name="silverlight_compatible" select="1" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Root template.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoEverything starts here! -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- SVG and groups
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico(including layers) -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'svg' or name(.) = 'g']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(.) = 'svg' or @transform or @viewBox or @id or @clip-path or (@style and contains(@style, 'clip-path:url(#')) or (@width and not(contains(@width, '%'))) or @x or @y or (@height and not(contains(@height, '%'))) or *[name(.) = 'linearGradient' or name(.) = 'radialGradient' or name(.) = 'defs' or name(.) = 'clipPath']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'display:none')"><xsl:attribute name="Visibility">Collapsed</xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(substring-after(@style, 'opacity:'), ';')"><xsl:value-of select="substring-before(substring-after(@style, 'opacity:'), ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="substring-after(@style, 'opacity:')" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width and not(contains(@width, '%'))">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@width" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@height and not(contains(@height, '%'))">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@height" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@x" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@y" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="viewBox"><xsl:value-of select="normalize-space(translate(@viewBox, ',', ' '))" /></xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Width"><xsl:value-of select="substring-before(substring-after(substring-after($viewBox, ' '), ' '), ' ')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Height"><xsl:value-of select="substring-after(substring-after(substring-after($viewBox, ' '), ' '), ' ')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <TranslateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="X"><xsl:value-of select="-number(substring-before($viewBox, ' '))" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Y"><xsl:value-of select="-number(substring-before(substring-after($viewBox, ' '), ' '))" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TranslateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <TransformGroup><xsl:apply-templates mode="transform" select="." /></TransformGroup>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="*[name(.) = 'linearGradient' or name(.) = 'radialGradient' or name(.) = 'defs' or name(.) = 'clipPath']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" select="*[name(.) = 'linearGradient' or name(.) = 'radialGradient' or name(.) = 'defs' or name(.) = 'clipPath']" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" select="*[name(.) != 'linearGradient' and name(.) != 'radialGradient' and name(.) != 'defs' and name(.) != 'clipPath']" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Resources (defs) //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Resources ids
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic defs template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic filters template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Filter effects
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Linked filter effects
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Linear gradients
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Radial gradients
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic gradient stops
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Resources ids -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!-- should be in-depth -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="ancestor::*[name(.) = 'defs']"><xsl:attribute name="x:Key"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic defs template -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic filters template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoLimited to one filter (can be improved) -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'filter']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Filter effects -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'feGaussianBlur']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <BlurEffect>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="../@id"><xsl:attribute name="x:Key"><xsl:value-of select="../@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@stdDeviation"><xsl:attribute name="Radius"><xsl:value-of select="round(@stdDeviation * 3)" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </BlurEffect>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Linked filter effect -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@filter and starts-with(@filter, 'url(#')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@filter, 'url(#'), ')'), '}')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'filter:url(#')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'filter:url(#'), ')'), '}')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Linear gradient -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'linearGradient']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <LinearGradientBrush>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@id"><xsl:attribute name="x:Key"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">Absolute</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>RelativeToBoundingBox</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@spreadMethod = 'pad'">Pad</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@spreadMethod = 'reflect'">Reflect</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@spreadMethod = 'repeat'">Repeat</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@x1, '%') and contains(@y1, '%')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StartPoint"><xsl:value-of select="concat(substring-before(@x1, '%') div 100, ',', substring-before(@y1,'%') div 100)" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StartPoint"><xsl:value-of select="concat(@x1, ',', @y1)" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@x2, '%') and contains(@y2, '%')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="EndPoint"><xsl:value-of select="concat(substring-before(@x2, '%') div 100, ',', substring-before(@y2,'%') div 100)" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="EndPoint"><xsl:value-of select="concat(@x2, ',', @y2)" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StartPoint"><xsl:value-of select="'0,0'" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="EndPoint"><xsl:value-of select="'1,1'" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="reference_id" select="@xlink:href" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" select="//*[name(.) = 'linearGradient' and $reference_id = concat('#', @id)]/*" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:apply-templates mode="forward" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </LinearGradientBrush>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Radial gradient -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'radialGradient']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RadialGradientBrush>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@id"><xsl:attribute name="x:Key"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">Absolute</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>RelativeToBoundingBox</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@spreadMethod = 'pad'">Pad</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@spreadMethod = 'reflect'">Reflect</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@spreadMethod = 'repeat'">Repeat</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@cx, '%') and contains(@cy, '%')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(number(substring-before(@cx, '%')) div 100, ',', number(substring-before(@cy, '%')) div 100)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@fx, '%') and contains(@fy, '%')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(number(substring-before(@fx, '%')) div 100, ',', number(substring-before(@fy, '%')) div 100)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="RadiusX"><xsl:value-of select="number(substring-before(@r, '%')) div 100" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="RadiusY"><xsl:value-of select="number(substring-before(@r, '%')) div 100" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="RadiusX"><xsl:value-of select="@r" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="RadiusY"><xsl:value-of select="@r" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="reference_id" select="@xlink:href" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" select="//*[name(.) = 'linearGradient' and $reference_id = concat('#', @id)]/*" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:apply-templates mode="forward" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RadialGradientBrush>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic gradient stops -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'stop']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <GradientStop>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="stop_opacity" select="." /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stop_color" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </GradientStop>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Clipping -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@clip-path and defs/clipPath/path/@d"><xsl:attribute name="Clip"><xsl:value-of select="defs/clipPath/path/@d" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@clip-path and starts-with(@clip-path, 'url(#')"><xsl:attribute name="Clip"><xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@clip-path, 'url(#'), ')'), '}')" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'clip-path:url(#')"><xsl:attribute name="Clip"><xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="clipPath"><xsl:apply-templates mode="forward" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Misc templates //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Object description
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Id converter
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Decimal to hexadecimal converter
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Unit to pixel converter
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Title and description
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Misc ignored stuff (markers, patterns, styles)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* RDF and foreign objects
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Unknows tags
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Object description -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="*[name(.) = 'desc']/text()"><xsl:attribute name="Tag"><xsl:value-of select="*[name(.) = 'desc']/text()" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Id converter. Removes "-" from the original id. -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Name"><xsl:value-of select="translate(@id, '- ', '')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="x:Key"><xsl:value-of select="translate(@id, '- ', '')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Decimal to hexadecimal converter -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(substring('0123456789ABCDEF', 1 + floor(round($convert) div 16), 1), substring('0123456789ABCDEF', 1 + round($convert) mod 16, 1))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Unit to pixel converter
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoValues with units (except %) are converted to pixels and rounded.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoUnknown units are kept. -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'px', ''))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.25)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'pc', '') * 15)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.543307)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'cm', '') * 35.43307)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'in', '') * 90)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1080)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="not(string(number($convert_value))='NaN')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Title and description
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoBlank template. Title is ignored and desc is converted to Tag in the mode="desc" template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'title' or name(.) = 'desc']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Misc ignored stuff (markers, patterns, styles) -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'marker' or name(.) = 'pattern' or name(.) = 'style']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Symbols -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'symbol']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@id"><xsl:attribute name="x:Key"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'use']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@xlink:href"><xsl:attribute name="Style"><xsl:value-of select="@xlink:href" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="transform" select="." /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- RDF and foreign objects -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="rdf:RDF | *[name(.) = 'foreignObject']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Unknown tags -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:comment><xsl:value-of select="concat('Unknown tag: ', name(.))" /></xsl:comment>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Colors and patterns //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic color template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Fill opacity
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic fill template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke opacity
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic stroke template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke width
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke mitterlimit
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke dasharray
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke dashoffset
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Linejoin SVG to XAML converter
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke linejoin
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Linecap SVG to XAML converter
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke linecap
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Gradient stop
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Gradient stop opacity
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Gradient stop offset
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic color template -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and not(contains($colorspec , '%'))">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1"><xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="round(number($opacityspec) * 255)" /></xsl:with-param></xsl:call-template></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="substring-before(substring-after($colorspec, 'rgb('), ',')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), ',')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), ')')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and contains($colorspec , '%')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1"><xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="round(number($opacityspec) * 255)" /></xsl:with-param></xsl:call-template></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="number(substring-before(substring-after($colorspec, 'rgb('), '%,')) * 255 div 100" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="number(substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), '%,')) * 255 div 100" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="number(substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), '%)')) * 255 div 100" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="$opacityspec != ''"><xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="round(number($opacityspec) * 255)" /></xsl:with-param></xsl:call-template></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="string-length(substring-after($colorspec, '#')) = 3">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="colorspec3"><xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" /></xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(substring($colorspec3, 1, 1), substring($colorspec3, 1, 1))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(substring($colorspec3, 2, 1), substring($colorspec3, 2, 1))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(substring($colorspec3, 3, 1), substring($colorspec3, 3, 1))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="named_color_hex" select="document('colors.xml')/colors/color[@name = translate($colorspec, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]/@hex" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$named_color_hex and $named_color_hex != ''">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1"><xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="number($opacityspec) * 255" /></xsl:with-param></xsl:call-template></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-after($named_color_hex, '#')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$colorspec" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Fill -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@fill and starts-with(@fill, 'url(#')"><xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@fill, 'url(#'), ')'), '}')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@fill"><xsl:value-of select="@fill" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill:') and starts-with(substring-after(@style, 'fill:'), 'url(#')"><xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Fill" select="substring-after(@style, 'fill:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-before($Fill, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$Fill" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="fill" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Fill opacity -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@fill-opacity"><xsl:value-of select="@fill-opacity" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'fill-opacity:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Opacity, ';')"><xsl:value-of select="substring-before($Opacity, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$Opacity" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="fill_opacity" select="parent::*" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Fill rule -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@fill-rule and (@fill-rule = 'nonzero' or @fill-rule = 'evenodd')"><xsl:attribute name="FillRule"><xsl:value-of select="@fill-rule" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill-rule:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="FillRule" select="substring-after(@style, 'fill-rule:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="substring-before($FillRule, ';') = 'nonzero' or substring-before($FillRule, ';') = 'evenodd'"><xsl:attribute name="FillRule"><xsl:value-of select="substring-before($FillRule, ';')" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$FillRule = 'nonzero' or $FillRule = 'evenodd'"><xsl:attribute name="FillRule"><xsl:value-of select="$FillRule" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="fill_rule" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:attribute name="FillRule">NonZero</xsl:attribute></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic fill template -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="fill"><xsl:apply-templates mode="fill" select="." /></xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="fill_opacity"><xsl:apply-templates mode="fill_opacity" select="." /></xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="$fill != 'none'"><xsl:value-of select="$fill" /></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="opacityspec"><xsl:value-of select="$fill_opacity" /></xsl:with-param>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke and starts-with(@stroke, 'url(#')"><xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@stroke, 'url(#'), ')'), '}')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke and @stroke != 'none'"><xsl:value-of select="@stroke" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke:') and starts-with(substring-after(@style, 'stroke:'), 'url(#')"><xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Stroke" select="substring-after(@style, 'stroke:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="substring-before($Stroke, ';') != 'none'"><xsl:value-of select="substring-before($Stroke, ';')" /></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$Stroke != 'none'"><xsl:value-of select="$Stroke" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke opacity -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke-opacity"><xsl:value-of select="@stroke-opacity" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'stroke-opacity:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Opacity, ';')"><xsl:value-of select="substring-before($Opacity, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$Opacity" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_opacity" select="parent::*" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic stroke template -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="stroke"><xsl:apply-templates mode="stroke" select="." /></xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="stroke_opacity"><xsl:apply-templates mode="stroke_opacity" select="." /></xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="colorspec"><xsl:value-of select="$stroke" /></xsl:with-param>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="opacityspec"><xsl:value-of select="$stroke_opacity" /></xsl:with-param>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke width -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeThickness"><xsl:value-of select="@stroke-width" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-width:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(substring-after(@style, 'stroke-width:'), ';')"><xsl:value-of select="substring-before(substring-after(@style, 'stroke-width:'), ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="substring-after(@style, 'stroke-width:')" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_width" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke miterlimit -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke-miterlimit"><xsl:attribute name="StrokeMiterLimit"><xsl:value-of select="@stroke-miterlimit" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-miterlimit:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeMiterLimit" select="substring-after(@style, 'stroke-miterlimit:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeMiterLimit, ';')"><xsl:value-of select="substring-before($StrokeMiterLimit, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$StrokeMiterLimit" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_miterlimit" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke dasharray -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!-- stroke-dasharray="10,30,20,30" becomes StrokeDashArray="1 3 2 3" ?? -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke-dasharray and @stroke-dasharray != 'none'"><xsl:attribute name="StrokeDashArray"><xsl:value-of select="@stroke-dasharray" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-dasharray:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeDashArray" select="substring-after(@style, 'stroke-dasharray:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="substring-before($StrokeDashArray, ';') != 'none'"><xsl:attribute name="StrokeDashArray"><xsl:value-of select="substring-before($StrokeDashArray, ';')" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$StrokeDashArray != 'none'"><xsl:attribute name="StrokeDashArray"><xsl:value-of select="$StrokeDashArray" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_dasharray" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke dashoffset -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke-dashoffset"><xsl:attribute name="StrokeDashOffset"><xsl:value-of select="@stroke-dashoffset" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-dashoffset:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeDashOffset" select="substring-after(@style, 'stroke-dashoffset:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeDashOffset, ';')"><xsl:value-of select="substring-before($StrokeDashOffset, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$StrokeDashOffset" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_dashoffset" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Linejoin SVG to XAML converter -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linejoin = 'bevel'">Bevel</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linejoin = 'round'">Round</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke linejoin -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linejoin_svg_to_xaml"><xsl:with-param name="linejoin"><xsl:value-of select="@stroke-linejoin" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-linejoin:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeLineJoin" select="substring-after(@style, 'stroke-linejoin:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linejoin_svg_to_xaml"><xsl:with-param name="linejoin"><xsl:value-of select="substring-before($StrokeLineJoin, ';')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linejoin_svg_to_xaml"><xsl:with-param name="linejoin"><xsl:value-of select="$StrokeLineJoin" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_linejoin" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Linecap SVG to XAML converter -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linecap = 'round'">Round</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linecap = 'square'">Square</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Stroke linecap -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linecap_svg_to_xaml"><xsl:with-param name="linecap"><xsl:value-of select="@stroke-linecap" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linecap_svg_to_xaml"><xsl:with-param name="linecap"><xsl:value-of select="@stroke-linecap" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-linecap:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeStartLineCap" select="substring-after(@style, 'stroke-linecap:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeEndLineCap" select="substring-after(@style, 'stroke-linecap:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeStartLineCap, ';')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linecap_svg_to_xaml"><xsl:with-param name="linecap"><xsl:value-of select="substring-before($StrokeStartLineCap, ';')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linecap_svg_to_xaml"><xsl:with-param name="linecap"><xsl:value-of select="$StrokeStartLineCap" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeEndLineCap, ';')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linecap_svg_to_xaml"><xsl:with-param name="linecap"><xsl:value-of select="substring-before($StrokeEndLineCap, ';')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="linecap_svg_to_xaml"><xsl:with-param name="linecap"><xsl:value-of select="$StrokeEndLineCap" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stroke_linecap" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Gradient stops -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stop-opacity"><xsl:value-of select="@stop-opacity" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="temp_opacity" select="substring-after(@style, 'stop-opacity:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($temp_opacity, ';')"><xsl:value-of select="substring-before($temp_opacity, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$temp_opacity" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="''" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$Opacity != ''"><xsl:call-template name="to_hex"><xsl:with-param name="convert"><xsl:value-of select="number($Opacity) * 255" /></xsl:with-param></xsl:call-template> </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$Opacity" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="template_color"><xsl:with-param name="colorspec"><xsl:value-of select="@stop-color" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-color:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Color" select="substring-after(@style, 'stop-color:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="template_color"><xsl:with-param name="colorspec"><xsl:value-of select="substring-before($Color, ';')" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="template_color"><xsl:with-param name="colorspec"><xsl:value-of select="$Color" /></xsl:with-param></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stop_color" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$hex_opacity != '' and starts-with($stopcolor, '#')"><xsl:value-of select="concat('#', $hex_opacity, substring-after($stopcolor, '#'))" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$stopcolor" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Gradient stop opacity -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stop-opacity"><xsl:attribute name="Opacity"><xsl:value-of select="@stop-opacity" /></xsl:attribute></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'stop-opacity:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Opacity, ';')"><xsl:value-of select="substring-before($Opacity, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$Opacity" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stop_opacity" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Gradient stop offset -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@offset, '%')"><xsl:value-of select="number(substring-before(@offset, '%')) div 100" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="@offset" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'offset:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Offset" select="substring-after(@style, 'offset:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Offset, '%')"><xsl:value-of select="number(substring-before($Offset, '%')) div 100" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Offset, ';')"><xsl:value-of select="substring-before($Offset, ';')" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$Offset" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'"><xsl:apply-templates mode="stop_offset" select="parent::*"/></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Transforms //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoAll the matrix, translate, rotate... stuff.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoFixme: XAML transforms don't show the same result as SVG ones with the same values.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Parse transform
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Apply transform
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Apply transform v2
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Parse transform -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <MatrixTransform><xsl:attribute name="Matrix"><xsl:value-of select="substring-before(substring-after($input, 'matrix('), ')')" /></xsl:attribute></MatrixTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="parse_transform"><xsl:with-param name="input" select="substring-after($input, ') ')" /></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <ScaleTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="scale" select="substring-before(substring-after($input, 'scale('), ')')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="ScaleX"><xsl:value-of select="substring-before($scale, ',')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="ScaleY"><xsl:value-of select="substring-after($scale, ',')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="ScaleX"><xsl:value-of select="$scale" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="ScaleY"><xsl:value-of select="$scale" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </ScaleTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="parse_transform"><xsl:with-param name="input" select="substring-after($input, ') ')" /></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RotateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Angle"><xsl:value-of select="substring-before(substring-after($input, 'rotate('), ')')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@rx"><xsl:attribute name="CenterX"><xsl:value-of select="@rx" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@ry"><xsl:attribute name="CenterY"><xsl:value-of select="@ry" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RotateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="parse_transform"><xsl:with-param name="input" select="substring-after($input, ') ')" /></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <SkewTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="AngleX"><xsl:value-of select="substring-before(substring-after($input, 'skewX('), ')')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="parse_transform"><xsl:with-param name="input" select="substring-after($input, ') ')" /></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </SkewTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <SkewTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="AngleY"><xsl:value-of select="substring-before(substring-after($input, 'skewY('), ')')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="parse_transform"><xsl:with-param name="input" select="substring-after($input, ') ')" /></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </SkewTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($input, 'translate(')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <TranslateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="translate" select="substring-before(substring-after($input, 'translate('), ')')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="X"><xsl:value-of select="substring-before($translate, ',')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Y"><xsl:value-of select="substring-after($translate, ',')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="X"><xsl:value-of select="substring-before($translate, ' ')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Y"><xsl:value-of select="substring-after($translate, ' ')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:attribute name="X"><xsl:value-of select="$translate" /></xsl:attribute></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TranslateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="parse_transform"><xsl:with-param name="input" select="substring-after($input, ') ')" /></xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Apply transform -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@transform"><xsl:value-of select="@transform" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="@gradientTransform" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="input" select="$transform" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$mapped_type and $mapped_type != ''">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:element name="{$mapped_type}.RenderTransform">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1"><xsl:copy-of select="libxslt:node-set($transform_nodes)" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) > 1"><TransformGroup><xsl:copy-of select="libxslt:node-set($transform_nodes)" /></TransformGroup></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!-- For instance LinearGradient.Transform -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1"><xsl:copy-of select="libxslt:node-set($transform_nodes)" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) > 1"><TransformGroup><xsl:copy-of select="libxslt:node-set($transform_nodes)" /></TransformGroup></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Apply transform v2
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoFixme: is this template still in use? -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <TransformGroup><xsl:apply-templates mode="transform" select="." /></TransformGroup>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Objects //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Image -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'image']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x"><xsl:attribute name="Canvas.Left">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@x" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y"><xsl:attribute name="Canvas.Top">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@y" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@xlink:href"><xsl:attribute name="Source"><xsl:value-of select="@xlink:href" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width"><xsl:attribute name="Width">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@width" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@height"><xsl:attribute name="Height">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@height" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Image'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="transform" /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Text -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'text']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@font-size"><xsl:attribute name="FontSize"><xsl:value-of select="@font-size" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-size:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="font_size" select="substring-after(@style, 'font-size:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-before($font_size, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$font_size" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@font-weight"><xsl:attribute name="FontWeight"><xsl:value-of select="@font-weight" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-weight:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="font_weight" select="substring-after(@style, 'font-weight:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-before($font_weight, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$font_weight" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@font-family"><xsl:attribute name="FontFamily"><xsl:value-of select="@font-family" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-family:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="font_family" select="substring-after(@style, 'font-family:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-before($font_family, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$font_family" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@font-style"><xsl:attribute name="FontStyle"><xsl:value-of select="@font-style" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-style:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="font_style" select="substring-after(@style, 'font-style:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-before($font_style, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$font_style" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@fill"><xsl:attribute name="Foreground"><xsl:value-of select="@fill" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'fill')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="fill" select="substring-after(@style, 'fill:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-before($fill, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise><xsl:value-of select="$fill" /></xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@text-anchor = 'start'">Left</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@text-anchor = 'middle'">Center</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@text-anchor = 'end'">Right</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width"><xsl:attribute name="Width">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@width" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@height"><xsl:attribute name="Height">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@height" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x"><xsl:attribute name="Canvas.Left">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@x" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y"><xsl:attribute name="Canvas.Top">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@y" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="transform" select="." /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="forward" /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="text()"><xsl:value-of select="text()" /></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="*[name(.) = 'tspan']/text()"><xsl:value-of select="*[name(.) = 'tspan']/text()" /></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TextBlock>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Lines -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'line']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x1"><xsl:attribute name="X1"><xsl:value-of select="@x1" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y1"><xsl:attribute name="Y1"><xsl:value-of select="@y1" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x2"><xsl:attribute name="X2"><xsl:value-of select="@x2" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y2"><xsl:attribute name="Y2"><xsl:value-of select="@y2" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Line'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Rectangle -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'rect']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x"><xsl:attribute name="Canvas.Left">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@x" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y"><xsl:attribute name="Canvas.Top">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@y" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width"><xsl:attribute name="Width">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@width" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@height"><xsl:attribute name="Height">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="convert_value" select="@height" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@rx"><xsl:attribute name="RadiusX"><xsl:value-of select="@rx" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@ry"><xsl:attribute name="RadiusY"><xsl:value-of select="@ry" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@rx and not(@ry)"><xsl:attribute name="RadiusX"><xsl:value-of select="@rx" /></xsl:attribute><xsl:attribute name="RadiusY"><xsl:value-of select="@rx" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@ry and not(@rx)"><xsl:attribute name="RadiusX"><xsl:value-of select="@ry" /></xsl:attribute><xsl:attribute name="RadiusY"><xsl:value-of select="@ry" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="resources" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Rectangle'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Rectangle>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Polygon -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'polygon']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@points"><xsl:attribute name="Points"><xsl:value-of select="@points" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="fill_rule" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Polygon'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Polyline -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'polyline']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@points"><xsl:attribute name="Points"><xsl:value-of select="@points" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="fill_rule" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Polyline'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Path -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'path']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="translate(@d , ',', ' ')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <PathGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="translate(@d , ',', ' ')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="fill_rule" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </PathGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Path'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Ellipse -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'ellipse']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cx"><xsl:value-of select="@cx" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cy"><xsl:value-of select="@cy" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Canvas.Left"><xsl:value-of select='format-number($cx - @rx, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Width"><xsl:value-of select='format-number(2 * @rx, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Canvas.Top"><xsl:value-of select='format-number($cy - @ry, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Height"><xsl:value-of select='format-number(2 * @ry, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Ellipse'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Circle -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'circle']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cx"><xsl:value-of select="@cx" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cy"><xsl:value-of select="@cy" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Canvas.Left"><xsl:value-of select='format-number($cx - @r, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Canvas.Top"><xsl:value-of select='format-number($cy - @r, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Width"><xsl:value-of select='format-number(2 * @r, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Height"><xsl:value-of select='format-number(2 * @r, "#.#")' /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="stroke_linecap" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Ellipse'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Geometry //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic clip path template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Geometry for circle
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Geometry for rectangle
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Generic clip path template -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'clipPath']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Geometry for circle -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="geometry" match="*[name(.) = 'circle']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <EllipseGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="../@id"><xsl:attribute name="x:Key"><xsl:value-of select="../@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@cx and @cy"><xsl:attribute name="Center"><xsl:value-of select="concat(@cx, ',', @cy)" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="RadiusX"><xsl:value-of select="@r" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="RadiusY"><xsl:value-of select="@r" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </EllipseGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!-- Geometry for rectangle -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="geometry" match="*[name(.) = 'rect']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RectangleGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="../@id"><xsl:attribute name="x:Key"><xsl:value-of select="../@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x"><xsl:attribute name="Canvas.Left"><xsl:value-of select="@x" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y"><xsl:attribute name="Canvas.Top"><xsl:value-of select="@y" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width"><xsl:attribute name="Width"><xsl:value-of select="@width" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@height"><xsl:attribute name="Height"><xsl:value-of select="@height" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@rx"><xsl:attribute name="RadiusX"><xsl:value-of select="@rx" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@ry"><xsl:attribute name="RadiusY"><xsl:value-of select="@ry" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Rect"><xsl:value-of select="concat('0, 0, ', @width, ', ', @height)" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RectangleGeometry>