svg2xaml.xsl revision c980cfbcfff398f6c5eeba39f65d8df29f8c6256
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoCopyright (c) 2005-2007 authors:
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoOriginal version: Toine de Greef (a.degreef@chello.nl)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNicoModified (2010-2011) 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">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico<xsl:param name="silverlight_compatible" select="0" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Containers //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Root templace
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Root template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // SVG and groups //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico (including layers)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'svg' or name(.) = 'g']">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="name(.) = 'svg' or @transform or @viewBox or @id or @clip-path or @filter 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']">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'display:none')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Visibility">Collapsed</xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'opacity:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(substring-after(@style, 'opacity:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'opacity:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'opacity:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width and not(contains(@width, '%'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@height and not(contains(@height, '%'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(@viewBox, ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after($viewBox, ' '), ' '), ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(substring-after(substring-after($viewBox, ' '), ' '), ' ')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <TranslateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="-number(substring-before($viewBox, ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="-number(substring-before(substring-after($viewBox, ' '), ' '))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TranslateTransform>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:with-param name="mapped_type" select="'Canvas'" />
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']" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Transforms //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico All the matrix, translate, rotate... stuff.
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Fixme: XAML transforms don't show the same result as SVG ones with the same values.
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Parse transform
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Apply transform
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Parse transform //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Matrix transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <MatrixTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'matrix('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </MatrixTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Scale transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <ScaleTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="scale" select="normalize-space(translate(substring-before(substring-after($input, 'scale('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($scale, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after($scale, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </ScaleTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Rotate transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <RotateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'rotate('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </RotateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Skew transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'skewX('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'skewY('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Translate transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="starts-with($input, 'translate(')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <TranslateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="translate" select="normalize-space(translate(substring-before(substring-after($input, 'translate('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($translate, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after($translate, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </TranslateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Apply transform //
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="values" select="normalize-space(translate($transform, ',', ' '))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="concat(substring-before($values, ') '), ')')" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="substring-after($values, $value1) != ''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="contains(substring-after($values, $value1), ') ')">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="normalize-space(concat(substring-before(substring-after($values, $value1), ') '), ')'))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="normalize-space(substring-after($values, $value1))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="$value2 != '' and substring-after($values, $value2) != ''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="contains(substring-after($values, $value2), ') ')">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="normalize-space(concat(substring-before(substring-after($values, $value2), ') '), ')'))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="normalize-space(substring-after($values, $value2))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$mapped_type and $mapped_type != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:element name="{$mapped_type}.RenderTransform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) > 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- For instance LinearGradient.Transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) > 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Resources (defs) //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Resources ids
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Generic defs template
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Generic filters template
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Filter effects
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Linked filter effects
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Linear gradients
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Radial gradients
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Generic gradient stops
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // 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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic defs template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'defs']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic filters template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Limited to one filter (can be improved)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'filter']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // GaussianBlur filter effects //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Blur values approximated with d = floor(s * 3*sqrt(2*pi)/4 + 0.5) from:
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Not supported by XAML:
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Horizontal and vertical blur.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'feGaussianBlur']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <BlurEffect>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="../@id"><xsl:attribute name="x:Key"><xsl:value-of select="../@id" /></xsl:attribute></xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="blur" select="normalize-space(translate(@stdDeviation, ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="floor($blur * 1.88 + 0.5)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="floor(substring-before($blur, ' ') * 1.88 + 0.5)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </BlurEffect>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linked filter effect //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Only supports blurs
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@filter and starts-with(@filter, 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@filter, 'url(#'), ')'), '}')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'filter:url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'filter:url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linear gradient //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'linearGradient']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <LinearGradientBrush>
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, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat(substring-before(@x1, '%') div 100, ',', substring-before(@y1,'%') div 100)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@x2, '%') and contains(@y2, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat(substring-before(@x2, '%') div 100, ',', substring-before(@y2,'%') div 100)" />
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 </GradientStopCollection>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="transform" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </LinearGradientBrush>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Radial gradient //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'radialGradient']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RadialGradientBrush>
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)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(@r, '%')) div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(@r, '%')) div 100" />
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 </GradientStopCollection>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="transform" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RadialGradientBrush>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stop //
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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Clipping //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@clip-path and defs/clipPath/path/@d">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@clip-path and starts-with(@clip-path, 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@clip-path, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'clip-path:url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Misc templates //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Id converter
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Decimal to hexadecimal converter
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Unit to pixel converter
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Object description
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Title and description
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * RDF and foreign objects
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Misc ignored stuff (markers, patterns, styles)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Unknows tags
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Id converter //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico 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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // 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))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Unit to pixel converter //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Values with units (except %) are converted to pixels and rounded.
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Unknown units are kept.
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico em, ex and % not implemented
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'px', ''))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.25)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'pc', '') * 15)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.543307)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'cm', '') * 35.43307)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'in', '') * 90)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1080)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="not(string(number($convert_value))='NaN')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Object description //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="*[name(.) = 'desc']/text()" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Title and description //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico 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']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Switch //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'switch']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Symbols //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'symbol']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico (since it is not supported by Inkscape, not implemented yet)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'use']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="transform" select="." /-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // RDF and foreign objects //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="rdf:RDF | *[name(.) = 'foreignObject']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Misc ignored stuff (markers, patterns, styles) //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'marker' or name(.) = 'pattern' or name(.) = 'style']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Unknown tags //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico With generic and mode="forward" templates
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('Unknown tag: ', name(.))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('Unknown tag: ', name(.))" />
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
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico* Image stretch
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic color template //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and not(contains($colorspec , '%'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(number($opacityspec) * 255)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after($colorspec, 'rgb('), ',')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), ',')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), ')')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and contains($colorspec , '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(number($opacityspec) * 255)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(substring-after($colorspec, 'rgb('), '%,')) * 255 div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), '%,')) * 255 div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), '%)')) * 255 div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(number($opacityspec) * 255)" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="string-length(substring-after($colorspec, '#')) = 3">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" />
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))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" />
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 != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number($opacityspec) * 255" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-after($named_color_hex, '#')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@fill and starts-with(@fill, 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@fill, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'fill:') and starts-with(substring-after(@style, 'fill:'), 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'fill:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="Fill" select="substring-after(@style, 'fill:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Fill, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Removes unwanted characters in the color link (TODO: export to a specific template)-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate($value, '"', ''))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Fill opacity //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'fill-opacity:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_opacity" select="parent::*" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Fill rule //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@fill-rule and (@fill-rule = 'nonzero' or @fill-rule = 'evenodd')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill-rule:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="FillRule" select="normalize-space(substring-after(@style, 'fill-rule:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="substring-before($FillRule, ';') = 'nonzero' or substring-before($FillRule, ';') = 'evenodd'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($FillRule, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$FillRule = 'nonzero' or $FillRule = 'evenodd'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_rule" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FillRule">NonZero</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // 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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stroke and starts-with(@stroke, 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@stroke, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'stroke:') and starts-with(substring-after(@style, 'stroke:'), 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Stroke" select="substring-after(@style, 'stroke:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="substring-before($Stroke, ';') != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Stroke, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke opacity //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'stroke-opacity:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_opacity" select="parent::*" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic stroke template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_opacity" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke width //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-width:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(substring-after(@style, 'stroke-width:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'stroke-width:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'stroke-width:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_width" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke miterlimit //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-miterlimit:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeMiterLimit" select="substring-after(@style, 'stroke-miterlimit:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($StrokeMiterLimit, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeMiterLimit, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke dasharray //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!-- stroke-dasharray="10,30,20,30" becomes StrokeDashArray="1 3 2 3" ?? -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stroke-dasharray and @stroke-dasharray != 'none'">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-dasharray:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeDashArray" select="substring-after(@style, 'stroke-dasharray:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="substring-before($StrokeDashArray, ';') != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeDashArray, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke dashoffset //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-dashoffset:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeDashOffset" select="substring-after(@style, 'stroke-dashoffset:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($StrokeDashOffset, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeDashOffset, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linejoin SVG to XAML converter //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linejoin = 'bevel'">Bevel</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linejoin = 'round'">Round</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke linejoin //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-linejoin:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeLineJoin" select="substring-after(@style, 'stroke-linejoin:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeLineJoin, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linecap SVG to XAML converter //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linecap = 'round'">Round</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linecap = 'square'">Square</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke linecap //
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, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeStartLineCap, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeEndLineCap, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeEndLineCap, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_linecap" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stops //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="temp_opacity" select="substring-after(@style, 'stop-opacity:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($temp_opacity, ';')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-color:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Color" select="substring-after(@style, 'stop-color:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Color, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stop_color" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$hex_opacity != '' and starts-with($stopcolor, '#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('#', $hex_opacity, substring-after($stopcolor, '#'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stop opacity //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'stop-opacity:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stop_opacity" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stop offset //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(@offset, '%')) div 100" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'offset:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Offset" select="substring-after(@style, 'offset:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before($Offset, '%')) div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Offset, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stop_offset" select="parent::*"/>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico // Image stretch //
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico SVG: preserveAspectRatio, XAML: Stretch
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="@style and contains(@style, 'preserveAspectRatio:')">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="ratio" select="normalize-space(substring-after(@style, 'preserveAspectRatio:'))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="substring-before($ratio, ';')" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:attribute name="Stretch">Fill</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text specific templates //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text tspan
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text flowPara
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text flowRegion (text frame)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Get font size
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Font weight
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Font family
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Font style
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Baseline shift
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Line height
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Writing mode
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text decoration
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text direction
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text position
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text object
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * FlowRoot object
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text span //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: tspan, flowSpan, FXG: span
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Not supported in FXG:
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * span position
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'tspan' or name(.) = 'flowSpan']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="whiteSpaceCollapse">preserve</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_weight" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_family" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_style" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_fill" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_decoration" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="line_height" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="baseline_shift" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text flowPara //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: flowPara, flowDiv FXG: p
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Not supported in FXG:
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * paragraph position
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'flowPara' or name(.) = 'flowDiv']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="whiteSpaceCollapse">preserve</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_weight" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_family" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_style" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_fill" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_decoration" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="line_height" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="baseline_shift" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="translate(text(), '	

', ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="normalize-space(translate(text(), '	

', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text flowRegion //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_position" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Get text font size //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'font-size:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="font_size" select="normalize-space(substring-after(@style, 'font-size:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($font_size, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="get_font_size" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font size //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-size, XAML: FontSize
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="get_font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font weight //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-weight, XAML: FontWeight
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-weight:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="font_weight" select="normalize-space(substring-after(@style, 'font-weight:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($font_weight, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value <= 100 or $value = 'lighter'">Thin</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 100 and $value <= 200">ExtraLight</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 200 and $value <= 300">Light</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="($value > 300 and $value <= 400) or $value ='normal'">Normal</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 400 and $value <= 500">Medium</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 500 and $value <= 600">SemiBold</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="($value > 600 and $value <= 700) or $value ='bold'">Bold</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 700 and $value <= 800">ExtraBold</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 800 and $value <= 900">Black</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value > 900 or $value = 'bolder'">ExtraBlack</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font family //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-family, XAML: FontFamily
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(@font-family, "'", '')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-family:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="font_family" select="normalize-space(substring-after(@style, 'font-family:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(substring-before($font_family, ';'), "'", '')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate($font_family, "'", '')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font style //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-style, XAML: FontStyle
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'font-style:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="font_style" select="normalize-space(substring-after(@style, 'font-style:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($font_style, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text baseline shift //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: baseline-shift, FXG: baselineShift
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'baseline-shift:') and not(contains(substring-after(@style, 'baseline-shift:'), ';'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'baseline-shift:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'baseline-shift:') and contains(substring-after(@style, 'baseline-shift:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'baseline-shift:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value='super'">superscript</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value='sub'">subscript</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="translate($value, '%', '') < -1000">-1000</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="translate($value, '%', '') > 1000">1000</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate($value, '%', '')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text line height //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: line-height, FXG: lineHeight
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'line-height:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="line_height" select="normalize-space(substring-after(@style, 'line-height:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($line_height, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text writing mode //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: writing-mode, FXG: blockProgression
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Values inverted in FXG...
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'writing-mode:') and not(contains(substring-after(@style, 'writing-mode:'), ';'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'writing-mode:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'writing-mode:') and contains(substring-after(@style, 'writing-mode:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'writing-mode:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="textRotation">rotate270</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text decoration //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: text-decoration, FXG: textDecoration, lineThrough
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'text-decoration:') and not(contains(substring-after(@style, 'text-decoration:'), ';'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'text-decoration:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'text-decoration:') and contains(substring-after(@style, 'text-decoration:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'text-decoration:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="textDecoration">underline</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="lineThrough">true</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text fill //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: fill, fill-opacity, XAML: Foreground
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text direction //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: direction, unicode-bidi, FXG: direction
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'direction:') and not(contains(substring-after(@style, 'direction:'), ';'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'direction:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'direction:') and contains(substring-after(@style, 'direction:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'direction:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'unicode-bidi:') and not(contains(substring-after(@style, 'unicode-bidi:'), ';'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'unicode-bidi:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'unicode-bidi:') and contains(substring-after(@style, 'unicode-bidi:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'unicode-bidi:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != '' and ($bidi='embed' or $bidi='bidi-override')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text size //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text position //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Keep the first x value only -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="substring-before(@x, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Keep the first y value only -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="substring-before(@y, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="get_font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$top_val != '' and $size_val != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Objects //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text objects //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: text, XAML: TextBlock
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'text']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_weight" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_family" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="font_style" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_fill" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_position" select="." />
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:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="transform" select="." /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="forward" /-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="translate(text(), '	

', ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="normalize-space(translate(text(), '	

', ' '))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TextBlock>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Line object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: line, XAML: Line
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'line']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_fill" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="template_stroke" 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'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Rectangle object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: rect, XAML: Rectangle
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'rect']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
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_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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Polygon object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: polygon, XAML: 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_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'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Polyline object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: polyline, XAML: 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_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'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: path, XAML: 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_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="." />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <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'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Ellipse object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: ellipse, XAML: 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_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'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Circle object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: circle, XAML: Ellipse
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_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'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Image object//
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: image, FXG: Image
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'image']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:apply-templates mode="image_stretch" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="mapped_type" select="'Image'" />
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>