svg2xaml.xsl revision 717017db28f8518249146bbe42267a9992258a4f
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<?xml version="1.0" encoding="UTF-8"?>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!--
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoCopyright (c) 2005-2007 authors:
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoOriginal version: Toine de Greef (a.degreef@chello.nl)
717017db28f8518249146bbe42267a9992258a4fJazzyNicoModified (2010-2014) by Nicolas Dufour (nicoduf@yahoo.fr) (blur support, units
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoconvertion, comments, and some other fixes)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
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:
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoThe above copyright notice and this permission notice shall be included in
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoall copies or substantial portions of the Software.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
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.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:stylesheet version="1.0"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:xlink="http://www.w3.org/1999/xlink"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:xs="http://www.w3.org/2001/XMLSchema"
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"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:exsl="http://exslt.org/common"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoxmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoexclude-result-prefixes="rdf xlink xs exsl libxslt">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:strip-space elements="*" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
717017db28f8518249146bbe42267a9992258a4fJazzyNico<xsl:param name="silverlight_compatible" select="$silverlight" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Containers //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Root templace
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Groups
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Root template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template match="/">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
717017db28f8518249146bbe42267a9992258a4fJazzyNico <xsl:when test="$silverlight_compatible = 'true'">
717017db28f8518249146bbe42267a9992258a4fJazzyNico <xsl:comment>
717017db28f8518249146bbe42267a9992258a4fJazzyNico <xsl:value-of select="'This file is compatible with Silverlight'" />
717017db28f8518249146bbe42267a9992258a4fJazzyNico </xsl:comment>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
717017db28f8518249146bbe42267a9992258a4fJazzyNico <xsl:comment>
717017db28f8518249146bbe42267a9992258a4fJazzyNico <xsl:value-of select="'This file is NOT compatible with Silverlight'" />
717017db28f8518249146bbe42267a9992258a4fJazzyNico </xsl:comment>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Viewbox Stretch="Uniform">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Viewbox>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // SVG and groups //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico (including layers)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'svg' or name(.) = 'g']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
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']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Canvas>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" select="." />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@style and contains(@style, 'display:none')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Visibility">Collapsed</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@style and contains(@style, 'opacity:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Opacity">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(substring-after(@style, 'opacity:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'opacity:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'opacity:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@width and not(contains(@width, '%'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Width">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@height and not(contains(@height, '%'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Height">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@x">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Left">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@y">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Top">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="resources" select="." />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@viewBox">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="viewBox">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(@viewBox, ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after($viewBox, ' '), ' '), ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(substring-after(substring-after($viewBox, ' '), ' '), ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Canvas.RenderTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <TranslateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="X">
d258b7ab81a56d38fd4e36832db8ae00006766a3JazzyNico <xsl:value-of select="format-number(-number(substring-before($viewBox, ' ')), '#.#')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Y">
d258b7ab81a56d38fd4e36832db8ae00006766a3JazzyNico <xsl:value-of select="format-number(-number(substring-before(substring-after($viewBox, ' '), ' ')), '#.#')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TranslateTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Canvas.RenderTransform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@transform">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:apply-templates mode="transform" select=".">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:with-param name="mapped_type" select="'Canvas'" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:apply-templates>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" select="*" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:if test="*[name(.) = 'linearGradient' or name(.) = 'radialGradient' or name(.) = 'defs' or name(.) = 'clipPath' or name(.) = 'filter']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Canvas.Resources>
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:apply-templates mode="forward" select="*[name(.) = 'linearGradient' or name(.) = 'radialGradient' or name(.) = 'defs' or name(.) = 'clipPath' or name(.) = 'filter']" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Canvas.Resources>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="not(@transform)">
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:apply-templates mode="forward" select="*[name(.) != 'linearGradient' and name(.) != 'radialGradient' and name(.) != 'defs' and name(.) != 'clipPath' and name(.) != 'filter']" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Canvas>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="not(@transform)">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" select="*" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
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
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Parse transform
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Apply transform
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Parse transform //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:param name="input" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Matrix transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="starts-with($input, 'matrix(')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <MatrixTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Matrix">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'matrix('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </MatrixTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Scale transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="starts-with($input, 'scale(')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <ScaleTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="scale" select="normalize-space(translate(substring-before(substring-after($input, 'scale('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($scale, ' ')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="ScaleX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($scale, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="ScaleY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after($scale, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="ScaleX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$scale" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="ScaleY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$scale" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </ScaleTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Rotate transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="starts-with($input, 'rotate(')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <RotateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Angle">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'rotate('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@rx">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="CenterX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@rx" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@ry">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="CenterY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@ry" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </RotateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Skew transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="starts-with($input, 'skewX(')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="AngleX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'skewX('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="starts-with($input, 'skewY(')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="AngleY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="normalize-space(translate(substring-before(substring-after($input, 'skewY('), ')'), ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </SkewTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
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:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($translate, ' ')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="X">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($translate, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Y">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after($translate, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="X">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$translate" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </TranslateTransform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="parse_transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="input" select="substring-after($input, ') ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Apply transform //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="transform" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:param name="mapped_type" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@transform or @gradientTransform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@transform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@transform" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@gradientTransform" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="values" select="normalize-space(translate($transform, ',', ' '))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="value1">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="contains($values, ') ')">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="concat(substring-before($values, ') '), ')')" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:when>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="$values" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:variable>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="value2">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="substring-after($values, $value1) != ''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:choose>
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:when>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="normalize-space(substring-after($values, $value1))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:if>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:variable>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="value3">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="$value2 != '' and substring-after($values, $value2) != ''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:choose>
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:when>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="normalize-space(substring-after($values, $value2))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:if>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:variable>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="transform_nodes">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="$value3 !=''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:call-template name="parse_transform">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:with-param name="input" select="$value3" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:call-template>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:if>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="$value2 !=''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:call-template name="parse_transform">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:with-param name="input" select="$value2" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:call-template>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:if>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="$value1 !=''">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:call-template name="parse_transform">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:with-param name="input" select="$value1" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:call-template>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="$mapped_type and $mapped_type != '' and not(contains($mapped_type, 'Geometry'))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:element name="{$mapped_type}.RenderTransform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) &gt; 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:element>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="$mapped_type and $mapped_type != '' and contains($mapped_type, 'Geometry')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:element name="{$mapped_type}.Transform">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) &gt; 1">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <TransformGroup>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </TransformGroup>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:element>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- For instance LinearGradient.Transform -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) = 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="count(libxslt:node-set($transform_nodes)/*) &gt; 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="libxslt:node-set($transform_nodes)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </TransformGroup>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Resources (defs) //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Resources ids
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Generic defs template
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Generic filters template
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Filter effects
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Linked filter effects
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico * Absolute gradients
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Linear gradients
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Radial gradients
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Generic gradient stops
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Clipping
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Resources ids //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="resources" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!-- should be in-depth -->
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="parent::*[name(.) = 'defs']"><xsl:attribute name="x:Key"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic defs template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'defs']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic filters template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Limited to one filter (can be improved)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'filter']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="count(*) = 1">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
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
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Not supported by XAML:
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Horizontal and vertical blur.
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
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:if test="@stdDeviation">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="blur" select="normalize-space(translate(@stdDeviation, ',', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="not(contains($blur, ' '))">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Radius">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="floor($blur * 1.88 + 0.5)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Radius">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="floor(substring-before($blur, ' ') * 1.88 + 0.5)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </BlurEffect>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico<!--
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico // Fake GaussianBlur filter effect //
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico Replaces all the other SVG effects with a zero radius blur effect.
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico-->
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico<xsl:template mode="forward" match="*[name(.) = 'feBlend' or name(.) = 'feColorMatrix' or name(.) = 'feComponentTransfer' or name(.) = 'feComposite' or name(.) = 'feConvolveMatrix' or name(.) = 'feDiffuseLighting' or name(.) = 'feDisplacementMap' or name(.) = 'feFlood' or name(.) = 'feImage' or name(.) = 'feMerge' or name(.) = 'feMorphology' or name(.) = 'feOffset' or name(.) = 'feSpecularLighting' or name(.) = 'feTile' or name(.) = 'feTurbulence']">
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico <xsl:comment>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico <xsl:value-of select="concat('Tag ', name(.), ' not supported, replaced with empty blur')" />
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico </xsl:comment>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico <BlurEffect>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico <xsl:if test="../@id"><xsl:attribute name="x:Key"><xsl:value-of select="../@id" /></xsl:attribute></xsl:if>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico <xsl:attribute name="Radius">
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico <xsl:value-of select="0" />
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico </xsl:attribute>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico </BlurEffect>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico</xsl:template>
de437a45e30aea01a2fcf7961c202a5117fb1789JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linked filter effect //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Only supports blurs
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="filter_effect" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@filter and starts-with(@filter, 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Effect">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@filter, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@style and contains(normalize-space(substring-after(translate(@style, '&quot;', ''), 'filter:')), 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Effect">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(normalize-space(substring-after(substring-after(translate(@style, '&quot;', ''), 'filter:'), 'url(#')), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<!--
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico // Absolute gradients //
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico Get the calling object position in order to substract it from the absolute gradient position.
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico (XAML absolute gradients values are absolute in the gradient's space).
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico-->
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<xsl:template mode="absolute_gradient" match="*">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:param name="position" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@id">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="id" select="concat('#', @id)"/>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="value">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:for-each select="//*[contains(@style,$id) or contains(@fill,$id) or contains(@stroke,$id)]">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="$position = 'y' and @y">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@y" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="$position = 'x' and @x">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@x" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:for-each>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="$value != ''">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="$value"/>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>0</xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico</xsl:template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linear gradient //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'linearGradient']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <LinearGradientBrush>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@id">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="x:Key">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@id" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="MappingMode">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">Absolute</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>RelativeToBoundingBox</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@spreadMethod">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="SpreadMethod">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
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:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="left">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="absolute_gradient" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="position" select="'x'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>0</xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="top">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="absolute_gradient" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="position" select="'y'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>0</xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@x1 and @y1 and @x2 and @y2">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@x1, '%') and contains(@y1, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StartPoint">
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:value-of select="concat(round(number(substring-before(@x1, '%')) div 100), ',', round(number(substring-before(@y1,'%')) div 100))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StartPoint">
fa6a04d2b08164ce6da6b36d4a6764bc274c183cJazzyNico <xsl:value-of select="concat(round((@x1 - $left)), ',', round((@y1 - $top)))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@x2, '%') and contains(@y2, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="EndPoint">
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:value-of select="concat(round(number(substring-before(@x2, '%')) div 100), ',', round(number(substring-before(@y2,'%')) div 100))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="EndPoint">
fa6a04d2b08164ce6da6b36d4a6764bc274c183cJazzyNico <xsl:value-of select="concat(round((@x2 - $left)), ',', round((@y2 - $top)))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StartPoint">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="'0,0'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="EndPoint">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="'1,1'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <LinearGradientBrush.GradientStops>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@xlink:href">
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:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </LinearGradientBrush.GradientStops>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@gradientTransform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <LinearGradientBrush.Transform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="transform" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </LinearGradientBrush.Transform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </LinearGradientBrush>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Radial gradient //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'radialGradient']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RadialGradientBrush>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@id">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="x:Key">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@id" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="MappingMode">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">Absolute</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>RelativeToBoundingBox</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@spreadMethod">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="SpreadMethod">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
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:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="left">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="absolute_gradient" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="position" select="'x'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>0</xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="top">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@gradientUnits = 'userSpaceOnUse' ">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="absolute_gradient" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="position" select="'y'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>0</xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@cx and @cy">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Center">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@cx, '%') and contains(@cy, '%')">
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:value-of select="concat(round(number(substring-before(@cx, '%')) div 100), ',', round(number(substring-before(@cy, '%')) div 100))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:value-of select="concat(round(@cx - $left), ',', round(@cy - $top))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@fx and @fy">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="GradientOrigin">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@fx, '%') and contains(@fy, '%')">
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:value-of select="concat(round(number(substring-before(@fx, '%')) div 100), ',', round(number(substring-before(@fy, '%')) div 100))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
97ee7e18184071adf0dc14fd993299aef66eececJazzyNico <xsl:value-of select="concat(round(@fx - $left), ',', round(@fy - $top))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@r">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains(@r, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(@r, '%')) div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(@r, '%')) div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@r" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@r" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RadialGradientBrush.GradientStops>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@xlink:href">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="reference_id" select="@xlink:href" />
4ea9bea02dc86bee697a25c1f8bd6e565aa5f14aJazzyNico <xsl:apply-templates mode="forward" select="//*[name(.) = 'linearGradient' and $reference_id = concat('#', @id)]/*" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </GradientStopCollection>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RadialGradientBrush.GradientStops>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@gradientTransform">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <RadialGradientBrush.Transform>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="transform" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </RadialGradientBrush.Transform>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RadialGradientBrush>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stop //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
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 <xsl:apply-templates mode="offset" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </GradientStop>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Clipping //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="clip" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@clip-path and defs/clipPath/path/@d">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Clip">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="defs/clipPath/path/@d" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@clip-path and starts-with(@clip-path, 'url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Clip">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@clip-path, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'clip-path:url(#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Clip">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(@style, 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="clipPath">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!--
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Misc templates //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Id converter
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Decimal to hexadecimal converter
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Unit to pixel converter
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Object description
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Title and description
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Switch
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Symbols
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Use
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * RDF and foreign objects
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Misc ignored stuff (markers, patterns, styles)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Unknows tags
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Id converter //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Removes "-" from the original id
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="id" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:if test="@id">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Name"><xsl:value-of select="translate(@id, '- ', '')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="x:Key"><xsl:value-of select="translate(@id, '- ', '')" /></xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Decimal to hexadecimal converter //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template name="to_hex">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:param name="convert" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="concat(substring('0123456789ABCDEF', 1 + floor(round($convert) div 16), 1), substring('0123456789ABCDEF', 1 + round($convert) mod 16, 1))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
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-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template name="convert_unit">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:param name="convert_value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'px')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'px', ''))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'pt')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.25)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'pc')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'pc', '') * 15)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'mm')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.543307)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'cm')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'cm', '') * 35.43307)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'in')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'in', '') * 90)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($convert_value, 'ft')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1080)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="not(string(number($convert_value))='NaN')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round($convert_value)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$convert_value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Object description //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="desc" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="*[name(.) = 'desc']/text()">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Tag">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="*[name(.) = 'desc']/text()" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Title and description //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Title is ignored and desc is converted to Tag in the mode="desc" template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'title' or name(.) = 'desc']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Switch //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'switch']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Symbols //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'symbol']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Style>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@id">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="x:Key">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@id" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Canvas>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Canvas>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Style>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Use //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico (since it is not supported by Inkscape, not implemented yet)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'use']">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<!-- Errors when more than one use element share the same reference
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Canvas>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@width and not(contains(@width, '%'))">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Width">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@width" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@height and not(contains(@height, '%'))">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Height">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@height" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@x">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Canvas.Left">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@x" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute></xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@y">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Canvas.Top">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@y" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <StaticResource>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:if test="@xlink:href">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="ResourceKey">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="substring-after(@xlink:href, '#')" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:attribute>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:if>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="forward" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </StaticResource>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Canvas>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // RDF and foreign objects //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="rdf:RDF | *[name(.) = 'foreignObject']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Misc ignored stuff (markers, patterns, styles) //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'marker' or name(.) = 'pattern' or name(.) = 'style']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Unknown tags //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico With generic and mode="forward" templates
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:comment>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('Unknown tag: ', name(.))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:comment>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:comment>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('Unknown tag: ', name(.))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:comment>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!--
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Colors and patterns //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic color template
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico* Object opacity
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Fill
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Fill opacity
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Fill rule
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic fill template
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Stroke
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
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic color template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template name="template_color">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:param name="colorspec" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:param name="opacityspec" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and not(contains($colorspec , '%'))">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="'#'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(number($opacityspec) * 255)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after($colorspec, 'rgb('), ',')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), ',')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), ')')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and contains($colorspec , '%')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="'#'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(number($opacityspec) * 255)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(substring-after($colorspec, 'rgb('), '%,')) * 255 div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), '%,')) * 255 div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), '%)')) * 255 div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="starts-with($colorspec, '#')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="'#'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="round(number($opacityspec) * 255)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="string-length(substring-after($colorspec, '#')) = 3">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="colorspec3">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </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:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="named_color_hex" select="document('colors.xml')/colors/color[@name = translate($colorspec, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]/@hex" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$named_color_hex and $named_color_hex != ''">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="'#'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$opacityspec != '' and number($opacityspec) != 1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number($opacityspec) * 255" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="substring-after($named_color_hex, '#')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$colorspec" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico<!--
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico // Object opacity //
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico-->
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico<xsl:template mode="object_opacity" match="*">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:if test="@opacity or (@style and (contains(@style, ';opacity:') or starts-with(@style, 'opacity:')))">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:variable name="value">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="@opacity">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="@opacity" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="@style and contains(@style, ';opacity:')">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:variable name="Opacity" select="substring-after(@style, ';opacity:')" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="contains($Opacity, ';')">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="$Opacity" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="@style and starts-with(@style, 'opacity:')">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'opacity:')" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="contains($Opacity, ';')">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="$Opacity" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="parent::*" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>1</xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:variable>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="Opacity">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value &lt; 0">0</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value &gt; 1">1</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="$value" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:attribute>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:if>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico</xsl:template>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Fill //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="fill" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@fill and starts-with(normalize-space(translate(@fill, '&quot;', '')), 'url(#')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <!-- Removes unwanted characters in the color link (TODO: export to a specific template)-->
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(normalize-space(translate(@fill, '&quot;', '')), 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@fill">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="normalize-space(@fill)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@style and contains(@style, 'fill:') and starts-with(normalize-space(substring-after(translate(@style, '&quot;', ''), 'fill:')), 'url(#')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(normalize-space(substring-after(substring-after(translate(@style, '&quot;', ''), 'fill:'), 'url(#')), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'fill:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="Fill" select="normalize-space(substring-after(@style, 'fill:'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($Fill, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Fill, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Fill" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Fill opacity //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="fill_opacity" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@fill-opacity">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="normalize-space(@fill-opacity)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill-opacity:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="Opacity" select="normalize-space(substring-after(@style, 'fill-opacity:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($Opacity, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_opacity" select="parent::*" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>1</xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &lt; 0">0</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 1">1</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Fill rule //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="fill_rule" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@fill-rule and (@fill-rule = 'nonzero' or @fill-rule = 'evenodd')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FillRule">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="normalize-space(@fill-rule)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'fill-rule:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="FillRule" select="normalize-space(substring-after(@style, 'fill-rule:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($FillRule, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="substring-before($FillRule, ';') = 'nonzero' or substring-before($FillRule, ';') = 'evenodd'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FillRule">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($FillRule, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$FillRule = 'nonzero' or $FillRule = 'evenodd'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FillRule">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$FillRule" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_rule" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FillRule">NonZero</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic fill template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="template_fill" match="*">
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="not($fill = 'none')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Fill">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$fill != ''">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="template_color">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="colorspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$fill != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$fill" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="opacityspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$fill_opacity" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:with-param>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>#000000</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stroke and starts-with(@stroke, 'url(#')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <!-- Removes unwanted characters in the color link (TODO: export to a specific template)-->
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(substring-after(normalize-space(translate(@stroke, '&quot;', '')), 'url(#'), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@stroke and normalize-space(@stroke) != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@style and contains(@style, 'stroke:') and starts-with(normalize-space(substring-after(translate(@style, '&quot;', ''), 'stroke:')), 'url(#')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="concat('{StaticResource ', substring-before(normalize-space(substring-after(substring-after(translate(@style, '&quot;', ''), 'stroke:'), 'url(#')), ')'), '}')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="Stroke" select="normalize-space(substring-after(@style, 'stroke:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Stroke, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="substring-before($Stroke, ';') != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Stroke, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$Stroke != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Stroke" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke opacity //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_opacity" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stroke-opacity">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke-opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </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:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($Opacity, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_opacity" select="parent::*" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>1</xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &lt; 0">0</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 1">1</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Generic stroke template //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="template_stroke" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="stroke">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="stroke_opacity">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_opacity" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="stroke_width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_width" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$stroke_width != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StrokeThickness">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$stroke_width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="$stroke != ''">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Stroke">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="template_color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="colorspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$stroke" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="opacityspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$stroke_opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke width //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_width" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke-width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke-width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-width:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(substring-after(@style, 'stroke-width:'), ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'stroke-width:'), ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-after(@style, 'stroke-width:')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_width" select="parent::*"/>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke miterlimit //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_miterlimit" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stroke-miterlimit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StrokeMiterLimit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="normalize-space(@stroke-miterlimit)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-miterlimit:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="StrokeMiterLimit" select="normalize-space(substring-after(@style, 'stroke-miterlimit:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeMiterLimit">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($StrokeMiterLimit, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeMiterLimit, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$StrokeMiterLimit" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke dasharray //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_dasharray" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!-- stroke-dasharray="10,30,20,30" becomes StrokeDashArray="1 3 2 3" ?? -->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@stroke-dasharray and normalize-space(@stroke-dasharray) != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StrokeDashArray">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke-dasharray" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </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:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeDashArray, ';')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="normalize-space(substring-before($StrokeDashArray, ';')) != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StrokeDashArray">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeDashArray, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="normalize-space($StrokeDashArray) != 'none'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="StrokeDashArray">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$StrokeDashArray" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_dasharray" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke dashoffset //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_dashoffset" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@stroke-dashoffset or (@style and contains(@style, 'stroke-dashoffset:'))">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="value">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@stroke-dashoffset">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="normalize-space(@stroke-dashoffset)" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="@style and contains(@style, 'stroke-dashoffset:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="StrokeDashOffset" select="normalize-space(substring-after(@style, 'stroke-dashoffset:'))" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="StrokeDashOffset">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:when test="contains($StrokeDashOffset, ';')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="substring-before($StrokeDashOffset, ';')" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="$StrokeDashOffset" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:otherwise>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="value != ''">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="StrokeDashOffset">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="$value" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_dashoffset" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linejoin SVG to XAML converter //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template name="linejoin_svg_to_xaml">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:param name="linejoin" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linejoin = 'bevel'">Bevel</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linejoin = 'round'">Round</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>Miter</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke linejoin //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_linejoin" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="@stroke-linejoin">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeLineJoin">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linejoin_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linejoin">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke-linejoin" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stroke-linejoin:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="StrokeLineJoin" select="substring-after(@style, 'stroke-linejoin:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeLineJoin">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeLineJoin, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linejoin_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linejoin">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeLineJoin, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linejoin_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linejoin">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$StrokeLineJoin" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Linecap SVG to XAML converter //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template name="linecap_svg_to_xaml">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:param name="linecap" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linecap = 'round'">Round</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="$linecap = 'square'">Square</xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>Flat</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Stroke linecap //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stroke_linecap" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stroke-linecap">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeStartLineCap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linecap_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linecap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke-linecap" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeEndLineCap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linecap_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linecap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stroke-linecap" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
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:attribute name="StrokeStartLineCap">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeStartLineCap, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linecap_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linecap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeStartLineCap, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linecap_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linecap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$StrokeStartLineCap" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="StrokeEndLineCap">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($StrokeEndLineCap, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linecap_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linecap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($StrokeEndLineCap, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="linecap_svg_to_xaml">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="linecap">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$StrokeEndLineCap" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stroke_linecap" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stops //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stop_color" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Opacity">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stop-opacity">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="normalize-space(@stop-opacity)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="temp_opacity" select="normalize-space(substring-after(@style, 'stop-opacity:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($temp_opacity, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($temp_opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$temp_opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="''" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="hex_opacity">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$Opacity != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="to_hex">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number($Opacity) * 255" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="stopcolor">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@stop-color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="template_color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="colorspec">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="normalize-space(@stop-color)" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'stop-color:')">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="Color" select="normalize-space(substring-after(@style, 'stop-color:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="contains($Color, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="template_color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="colorspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Color, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="template_color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="colorspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Color" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stop_color" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:otherwise>#000000</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Color">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$hex_opacity != '' and starts-with($stopcolor, '#')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="concat('#', $hex_opacity, substring-after($stopcolor, '#'))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$stopcolor" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stop opacity //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="stop_opacity" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@stop-opacity">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Opacity">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@stop-opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </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:attribute name="Opacity">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($Opacity, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Opacity" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stop_opacity" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Gradient stop offset //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="offset" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@offset">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Offset">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(@offset, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before(@offset, '%')) div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@offset" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@style and contains(@style, 'offset:')">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="Offset" select="substring-after(@style, 'offset:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Offset">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($Offset, '%')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="number(substring-before($Offset, '%')) div 100" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($Offset, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($Offset, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$Offset" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="stop_offset" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico<!--
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico // Image stretch //
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico SVG: preserveAspectRatio, XAML: Stretch
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico-->
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico<xsl:template mode="image_stretch" match="*">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="value">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="@preserveAspectRatio">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="@preserveAspectRatio" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:when>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="@style and contains(@style, 'preserveAspectRatio:')">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:variable name="ratio" select="normalize-space(substring-after(@style, 'preserveAspectRatio:'))" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:when test="contains($ratio, ';')">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="substring-before($ratio, ';')" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:when>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="$ratio" />
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:otherwise>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:when>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:choose>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:variable>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:if test="$value = 'none'">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:attribute name="Stretch">Fill</xsl:attribute>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico </xsl:if>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico</xsl:template>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text specific templates //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text tspan
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text flowPara
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text flowRegion (text frame)
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Get font size
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * 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 fill
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text direction
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text size
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text position
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text object
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * FlowRoot object
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text span //
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico SVG: tspan, flowSpan, XAML: Span
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico Not supported in XAML:
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * span position
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'tspan' or name(.) = 'flowSpan']">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <Span>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="../@xml:space='preserve'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="whiteSpaceCollapse">preserve</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="fill">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="Foreground">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="template_color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="colorspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$fill" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="text()">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="text()" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </Span>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text flowPara //
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico SVG: flowPara, flowDiv XAML: ?
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'flowPara' or name(.) = 'flowDiv']">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="*[name(.) = 'flowSpan']/text()">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="forward" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="@xml:space='preserve'">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:copy-of select="translate(text(), '&#x9;&#xA;&#xD;', ' ')" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:copy-of select="normalize-space(translate(text(), '&#x9;&#xA;&#xD;', ' '))" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text flowRegion //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="flow_region" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_position" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Get text font size //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="get_font_size" match="*">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@font-size">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@font-size" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@style and contains(@style, 'font-size:')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="font_size" select="normalize-space(substring-after(@style, 'font-size:'))" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($font_size, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($font_size, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$font_size" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg' or name(..) = 'text' or name(..) = 'flowPara' or name(..) = 'flowRoot'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="get_font_size" select="parent::*"/>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font size //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-size, XAML: FontSize
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="font_size" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="get_font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FontSize">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FontSize">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value != ''">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>12</xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font weight //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-weight, XAML: FontWeight
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="font_weight" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@font-weight">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@font-weight" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
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:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($font_weight, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($font_weight, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$font_weight" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FontWeight">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &lt;= 100 or $value = 'lighter'">Thin</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 100 and $value &lt;= 200">ExtraLight</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 200 and $value &lt;= 300">Light</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="($value &gt; 300 and $value &lt;= 400) or $value ='normal'">Normal</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 400 and $value &lt;= 500">Medium</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 500 and $value &lt;= 600">SemiBold</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="($value &gt; 600 and $value &lt;= 700) or $value ='bold'">Bold</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 700 and $value &lt;= 800">ExtraBold</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 800 and $value &lt;= 900">Black</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value &gt; 900 or $value = 'bolder'">ExtraBlack</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>normal</xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font family //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-family, XAML: FontFamily
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="font_family" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@font-family">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(@font-family, &quot;'&quot;, '')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
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:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($font_family, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate(substring-before($font_family, ';'), &quot;'&quot;, '')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="translate($font_family, &quot;'&quot;, '')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FontFamily">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value='Sans'">Arial</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text font style //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: font-style, XAML: FontStyle
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="font_style" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@font-style">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@font-style" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
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:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($font_style, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($font_style, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$font_style" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="FontStyle">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text baseline shift //
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico SVG: baseline-shift, XAML: BaselineAlignment
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="baseline_shift" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@baseline-shift">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@baseline-shift" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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>
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:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:if test="$value = 'baseline' or $value='super' or $value='sub'">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="BaselineAlignment">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='baseline'">Normal</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='super'">Superscript</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='sub'">Subscript</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="contains($value, '%')">%</xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text line height //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: line-height, FXG: lineHeight
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="line_height" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@line-height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@line-height" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains($line_height, ';')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="substring-before($line_height, ';')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$line_height" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="lineHeight">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text writing mode //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: writing-mode, FXG: blockProgression
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico Values inverted in FXG...
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="writing_mode" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@writing-mode">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@writing-mode" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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>
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:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="blockProgression">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value='tb'">rl</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>tb</xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value='tb'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="textRotation">rotate270</xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text decoration //
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico SVG: text-decoration, XAML: TextDecorations
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="text_decoration" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@text-decoration">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@text-decoration" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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>
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:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:if test="$value != ''">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="TextDecorations">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='underline'">Underline</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='line-through'">Strikethrough</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='overline'">Overline</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:otherwise>None</xsl:otherwise>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text fill //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: fill, fill-opacity, XAML: Foreground
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="text_fill" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="fill">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="fill_opacity">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Foreground">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="template_color">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="colorspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$fill" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="opacityspec">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$fill_opacity">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$fill_opacity" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>1</xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:with-param>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text direction //
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico SVG: direction, unicode-bidi, XAML: FlowDirection
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="direction" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@direction">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@direction" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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>
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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="bidi">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@unicode-bidi">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@unicode-bidi" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
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:')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
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>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$value != '' and ($bidi='embed' or $bidi='bidi-override')">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="FlowDirection">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='ltr'">LeftToRight</xsl:when>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="$value='rtl'">RightToLeft</xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text size //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="text_size" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text position //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="text_position" match="*">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Keep the first x value only -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@x">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Left">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(@x, ' ')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="substring-before(@x, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <!-- Keep the first y value only -->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@y">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Top">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="top_val">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="contains(@y, ' ')">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="substring-before(@y, ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="size_val">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:variable name="value">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="get_font_size" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="$value != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="$value" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>12</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:variable>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="$top_val != '' and $size_val != ''">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="$top_val - $size_val" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Objects //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Text
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Lines
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Rectangle
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Polygon
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Polyline
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Path
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Ellipse
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Circle
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico * Image
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Text objects //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: text, XAML: TextBlock
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico<xsl:template mode="forward" match="*[name(.) = 'text' or name(.) = 'flowRoot']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <TextBlock>
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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="text_decoration" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="direction" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="text_position" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:if test="name(.) = 'flowRoot'">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:attribute name="TextWrapping">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:value-of select="'Wrap'" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:attribute>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@text-anchor">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="HorizontalAlignment">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
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:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:if test="name(.) = 'flowRoot'">
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="flow_region" select="*[name(.) = 'flowRegion']/child::node()" />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="transform" select="." /-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <!--xsl:apply-templates mode="forward" /-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:when test="*[name(.) = 'tspan' or name(.) = 'flowPara' or name(.) = 'flowDiv']/text()">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:when test="@xml:space='preserve'">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="translate(text(), '&#x9;&#xA;&#xD;', ' ')" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:when>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:copy-of select="normalize-space(translate(text(), '&#x9;&#xA;&#xD;', ' '))" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:otherwise>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:choose>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </TextBlock>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Line object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: line, XAML: Line
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'line']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Line>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@x1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="X1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@x1" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@y1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Y1">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@y1" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@x2">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="X2">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@x2" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@y2">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Y2">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@y2" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" 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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Line'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Line>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Rectangle object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: rect, XAML: Rectangle
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'rect']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Rectangle>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@x">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Left">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@y">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Top">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Height">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@rx">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@rx" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@ry">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@ry" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@rx and not(@ry)">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusX">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@rx" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="RadiusY">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@rx" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </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
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" 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:apply-templates mode="resources" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Rectangle'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Rectangle>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Polygon object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: polygon, XAML: Polygon
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'polygon']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Polygon>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@points"><xsl:attribute name="Points"><xsl:value-of select="@points" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" select="." />
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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Polygon'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Polygon>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Polyline object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: polyline, XAML: Polyline
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'polyline']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Polyline>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@points"><xsl:attribute name="Points"><xsl:value-of select="@points" /></xsl:attribute></xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" select="." />
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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Polyline'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Polyline>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Path //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: path, XAML: Path
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'path']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Path>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" 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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="clip" select="." />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@d">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
717017db28f8518249146bbe42267a9992258a4fJazzyNico <xsl:when test="$silverlight_compatible = 'true'">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Data">
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:value-of select="translate(@d , ',', ' ')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Path.Data>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <PathGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:attribute name="Figures">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:value-of select="translate(@d , ',', ' ')" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="fill_rule" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </PathGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Path.Data>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Path'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Path>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Ellipse object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: ellipse, XAML: Ellipse
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'ellipse']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Ellipse>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="cx">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cx"><xsl:value-of select="@cx" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>0</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="cy">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cy"><xsl:value-of select="@cy" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>0</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@rx">
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:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@ry">
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:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" 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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Ellipse'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Ellipse>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Circle object //
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: circle, XAML: Ellipse
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'circle']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <Ellipse>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="cx">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cx"><xsl:value-of select="@cx" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>0</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:variable name="cy">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:when test="@cy"><xsl:value-of select="@cy" /></xsl:when>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:otherwise>0</xsl:otherwise>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:choose>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:variable>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@r">
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:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="id" 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="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="desc" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="clip" select="." />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="transform" select=".">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:with-param name="mapped_type" select="'Ellipse'" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="forward" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </Ellipse>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<!--
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico // Image object//
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico SVG: image, FXG: Image
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico-->
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico<xsl:template mode="forward" match="*[name(.) = 'image']">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <Image>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="id" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@x">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Left">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@x" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@y">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Canvas.Top">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@y" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="desc" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="clip" select="." />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@xlink:href">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Source">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:value-of select="@xlink:href" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Width">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@width" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:if test="@height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:attribute name="Height">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:call-template name="convert_unit">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="convert_value" select="@height" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:call-template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:attribute>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:if>
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico
c980cfbcfff398f6c5eeba39f65d8df29f8c6256JazzyNico <xsl:apply-templates mode="image_stretch" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="object_opacity" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico <xsl:apply-templates mode="resources" select="." />
3188572e17610177ff8f0f999ac7853d026bc88dJazzyNico
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="transform" select=".">
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:with-param name="mapped_type" select="'Image'" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </xsl:apply-templates>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico <xsl:apply-templates mode="forward" />
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico </Image>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico</xsl:template>
b1c372edfc964321a8f7a9c3487e24bb9b170b98JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<!--
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico// Geometry //
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Generic clip path template
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico* Geometry for path
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Geometry for circle
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico* Geometry for rectangle
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<!--
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico // Generic clip path template //
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="forward" match="*[name(.) = 'clipPath']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:apply-templates mode="geometry" />
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<!--
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico // Clip Geometry for path //
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico TODO: PathGeometry is positionned in the object's space, and thus needs to be translated.
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico-->
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<xsl:template mode="geometry" match="*[name(.) = 'path']">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <PathGeometry>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="../@id">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="x:Key">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="../@id" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Figures">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="translate(@d , ',', ' ')" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="fill_rule" select="." />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="transform" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="mapped_type" select="'PathGeometry'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </PathGeometry>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico</xsl:template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<!--
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico // Clip Geometry for circle //
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico-->
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<xsl:template mode="geometry" match="*[name(.) = 'circle' or name(.) = 'ellipse']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <EllipseGeometry>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="../@id">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="x:Key">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="../@id" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@cx and @cy">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Center">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="concat(@cx, ',', @cy)" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <xsl:if test="@r">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusX">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@r" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusY">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@r" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@rx">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusX">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@rx" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@ry">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusY">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@ry" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="transform" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="mapped_type" select="'EllipseGeometry'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </EllipseGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico<!--
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico // Clip Geometry for rectangle //
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico-->
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico<xsl:template mode="geometry" match="*[name(.) = 'rect']">
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico <RectangleGeometry>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="../@id">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="x:Key">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="../@id" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="x">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@x" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="y">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@y" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="width">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@width" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:variable name="height">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:call-template name="convert_unit">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="convert_value" select="@height" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:call-template>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:variable>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@rx">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusX">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@rx" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@ry">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusY">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@ry" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@rx and not(@ry)">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusX">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@rx" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusY">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@rx" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:if test="@ry and not(@rx)">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusX">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@ry" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="RadiusY">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:value-of select="@ry" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:if>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:attribute name="Rect"><xsl:value-of select="concat($x, ', ', $y, ', ', $width, ', ', $height)" /></xsl:attribute>
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:apply-templates mode="transform" select=".">
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico <xsl:with-param name="mapped_type" select="'RectangleGeometry'" />
ea55869971330306b308c104a7c1780119bb4b0eJazzyNico </xsl:apply-templates>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico </RectangleGeometry>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:template>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico</xsl:stylesheet>