svg2fxg.xsl revision 935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<?xml version="1.0" encoding="UTF-8"?>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoAuthors:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Nicolas Dufour <nicoduf@yahoo.fr>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoCopyright (c) 2010 authors
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoReleased under GNU GPL, read the file 'COPYING' for more information
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:stylesheet version="1.0"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:xlink="http://www.w3.org/1999/xlink"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:xs="http://www.w3.org/2001/XMLSchema"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns="http://ns.adobe.com/fxg/2008"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:fxg="http://ns.adobe.com/fxg/2008"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:d="http://ns.adobe.com/fxg/2008/dt"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:exsl="http://exslt.org/common"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:math="http://exslt.org/math"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoxmlns:svg="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoexclude-result-prefixes="rdf xlink xs exsl libxslt"
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNicoextension-element-prefixes="math">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:strip-space elements="*" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Containers //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Root templace
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Graphic attributes
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Groups
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Root template //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template match="/">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Graphic //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico First SVG element is converted to Graphic
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="/*[name(.) = 'svg']" priority="1">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Graphic>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="version">2.0</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width and not(contains(@width, '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="viewWidth">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@height and not(contains(@height, '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="viewHeight">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width and not(contains(@width, '%')) and @height and not(contains(@height, '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <SolidColor color="#ffffff" alpha="1"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Graphic>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // inner SVG elements //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Converted to groups
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'svg']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width and not(contains(@width, '%')) and @height and not(contains(@height, '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="maskType"><xsl:value-of select="'clip'"/></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <SolidColor color="#ffffff" alpha="1"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Groups //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico (including layers)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico FXG's Group doesn't support other elements attributes (such as font-size, etc.)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'g']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'display:none')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="Visibility">Collapsed</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width and not(contains(@width, '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@height and not(contains(@height, '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="layer_blend" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" select="*" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Transforms //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico All the matrix, translate, rotate... stuff.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Parse objects transform
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Object transform
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Parse gradient transform
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Gradient transform
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported by FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Skew transform.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Multiple values rotation.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Parse object transform //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="parse_object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="input" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Matrix transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'matrix(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <transform>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Transform>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <matrix>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Matrix>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="matrix" select="normalize-space(translate(substring-before(substring-after($input, 'matrix('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="a" select="substring-before($matrix, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="ra" select="substring-after($matrix, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="b" select="substring-before($ra, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="rb" select="substring-after($ra, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="c" select="substring-before($rb, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="rc" select="substring-after($rb, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="d" select="substring-before($rc, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="rd" select="substring-after($rc, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="tx" select="substring-before($rd, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="ty" select="substring-after($rd, ' ')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="a"><xsl:value-of select="$a" /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="b"><xsl:value-of select="$b" /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="c"><xsl:value-of select="$c" /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="d"><xsl:value-of select="$d" /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="tx"><xsl:value-of select='format-number($tx, "#.##")' /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="ty"><xsl:value-of select='format-number($ty, "#.##")' /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Matrix>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </matrix>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Transform>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </transform>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Scale transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'scale(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="scale" select="normalize-space(translate(substring-before(substring-after($input, 'scale('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($scale, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($scale, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($scale, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$scale" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$scale" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Rotate transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'rotate(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="rotate" select="normalize-space(translate(substring-before(substring-after($input, 'rotate('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="rotation">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($rotate, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($rotate, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$rotate" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@rx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="CenterX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@rx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@ry">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="CenterY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@ry" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Translate transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'translate(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="translate" select="normalize-space(translate(substring-before(substring-after($input, 'translate('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($translate, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($translate, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($translate, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$translate" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Object transform //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico FXG needs a separate group for each transform type in the transform attribute (scale+translate != translate+scale)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="values" select="normalize-space(translate($transform, ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($values, ') ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="parse_object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="input" select="concat(substring-before($values, ') '), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="values2" select="substring-after($values, ') ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($values2, ') ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="parse_object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="input" select="concat(substring-before($values2, ') '), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="values3" select="substring-after($values2, ') ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="parse_object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="input" select="concat($values3, ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="parse_object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="input" select="$values2" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="parse_object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="input" select="$values" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Parse gradient transform //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="parse_gradient_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="input" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="type" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Scale transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'scale(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="scale" select="normalize-space(translate(substring-before(substring-after($input, 'scale('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$type='radial'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($scale, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($scale, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($scale, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$scale" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$scale" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="scaleX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$scale" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Rotate transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'rotate(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="rotate" select="normalize-space(translate(substring-before(substring-after($input, 'rotate('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="rotation">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($rotate, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($rotate, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$rotate" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Translate transform -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($input, 'translate(')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="translate" select="normalize-space(translate(substring-before(substring-after($input, 'translate('), ')'), ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($translate, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($translate, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($translate, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$translate" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Gradient transform //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not implemented yet
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Gradient positioning and tranformation are very different in FXG
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="gradient_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="type" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="contains($transform, 'translate')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="parse_gradient_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="input" select="concat('translate(', substring-before(substring-after($transform, 'translate('), ')'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="type" select="$type" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Resources (defs) //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Resources ids
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Generic defs template
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Defs gradients
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Layers blend mode
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Generic filters template
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Filter effects
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Linked filter effects
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Linear gradients
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Radial gradients
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Gradient stops list
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Gradient stop
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Clipping
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Resources ids //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="resources" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- should be in-depth -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="ancestor::*[name(.) = 'defs']"><xsl:attribute name="id"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Generic defs template //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="defs">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!-- Ignoring defs, do nothing
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Defs gradients //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico ignored
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'linearGradient' or name(.) = 'radialGradient']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Layers blend mode //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Partial support
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Looks good with normal, multiply, and darken
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="layer_blend" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@inkscape:groupmode='layer' and @style and contains(@style, 'filter:url(#')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="id" select="substring-before(substring-after(@style, 'filter:url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="name(child::node()) = 'feBlend'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="blendMode">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="child::node()/@mode"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Generic filters template //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Limited to one filter (can be improved)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'filter']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="count(*) = 1">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // GaussianBlur filter effects //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Blur values approximated with d = floor(s * 3*sqrt(2*pi)/4 + 0.5) from:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Blur quality=2 recommended by the FXG specifications:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico http://opensource.adobe.com/wiki/display/flexsdk/FXG+2.0+Specification#FXG2.0Specification-FilterEffects
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'feGaussianBlur']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="name(.)='feGaussianBlur'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <filters>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <BlurFilter>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="quality">2</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@stdDeviation">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="blur" select="normalize-space(translate(@stdDeviation, ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="not(contains($blur, ' '))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="blurX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="floor($blur * 1.88 + 0.5)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="blurY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="floor($blur * 1.88 + 0.5)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="blurX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="floor(substring-before($blur, ' ') * 1.88 + 0.5)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="blurY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="floor(substring-after($blur, ' ') * 1.88 + 0.5)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </BlurFilter>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </filters>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Linked filter effect //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Only supports blurs
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="filter_effect" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@filter and starts-with(@filter, 'url(#')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@filter, 'url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'filter:url(#')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'filter:url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Linear gradient //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Full convertion to FXG would require some math.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="linearGradient">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="id" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@id" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@spreadMethod">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="spreadMethod">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@spreadMethod = 'pad'">pad</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@spreadMethod = 'reflect'">reflect</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@spreadMethod = 'repeat'">repeat</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@color-interpolation">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="interpolationMethod">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@color-interpolation = 'linearRGB'">linearRGB</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>rgb</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x1 and @x2 and @y1 and @y2 and function-available('math:atan')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="rotation">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="57.3 * math:atan((@y2 - @y1) div (@x2 - @x1))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@gradientTransform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="gradient_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@gradientTransform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="type" select="linear" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@xlink:href">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="reference_id" select="@xlink:href" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="gradientStops" >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($reference_id, '#')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise><xsl:apply-templates mode="forward" /></xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Radial gradient //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Full convertion to FXG would require some math.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="radialGradient">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="id" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@id" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@spreadMethod">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="spreadMethod">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@spreadMethod = 'pad'">pad</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@spreadMethod = 'reflect'">reflect</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@spreadMethod = 'repeat'">repeat</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@color-interpolation">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="interpolationMethod">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@color-interpolation = 'linearRGB'">linearRGB</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>rgb</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@gradientTransform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="gradient_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@gradientTransform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="type" select="radial" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@xlink:href">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="reference_id" select="@xlink:href" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="gradientStops" >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($reference_id, '#')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise><xsl:apply-templates mode="forward" /></xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Gradient stops list //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico TODO: Find a way to test the existence of the node-set
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="gradientStops">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="id" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stops">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="not($stops)">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <GradientEntry>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alpha">0</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </GradientEntry>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise><xsl:copy-of select="$stops" /></xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Gradient stop //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'stop']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <GradientEntry>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--xsl:apply-templates mode="stop_opacity" select="." /-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stop_color" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="offset" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </GradientEntry>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Clipping and masking//
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="clip" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="clip_type" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$clip_type='clip' and @clip-path and contains(@clip-path, 'url')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="maskType"><xsl:value-of select="'clip'"/></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clip_id" select="substring-before(substring-after(@clip-path, 'url(#'), ')')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$clip_id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="not(@clipPathUnits) or @clipPathUnits != 'objectBoundingBox'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$object"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$clip_type='mask' and @mask and contains(@mask, 'url')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="maskType"><xsl:value-of select="'alpha'"/></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="mask_id" select="substring-before(substring-after(@mask, 'url(#'), ')')"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=$mask_id]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="not(@maskUnits) or @maskUnits != 'objectBoundingBox'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </mask>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$object"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Misc templates //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Id converter
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Decimal to hexadecimal converter
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Unit to pixel converter
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Switch
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Unknows tags
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Object description (not supported)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Title and description (not supported)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Symbols (not supported)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Use (not supported)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * RDF and foreign objects (not supported)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Misc ignored stuff (markers, patterns, styles)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Id converter //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Removes "-" from the original id
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico (Not sure FXG really needs it)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="id" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="id"><xsl:value-of select="translate(@id, '- ', '')" /></xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Decimal to hexadecimal converter //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="convert" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="concat(substring('0123456789ABCDEF', 1 + floor(round($convert) div 16), 1), substring('0123456789ABCDEF', 1 + round($convert) mod 16, 1))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Unit to pixel converter //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Values with units (except %) are converted to pixels and rounded.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Unknown units are kept.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico em, ex and % not implemented
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="convert_value" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'px')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'px', ''))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'pt')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.25)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'pc')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'pc', '') * 15)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'mm')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.543307)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'cm')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'cm', '') * 35.43307)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'in')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'in', '') * 90)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($convert_value, 'ft')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1080)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="not(string(number($convert_value))='NaN')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="round($convert_value)" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$convert_value" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Switch //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'switch']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Unknown tags //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico With generic and mode="forward" templates
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment><xsl:value-of select="concat('Unknown tag: ', name(.))" /></xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment><xsl:value-of select="concat('Unknown tag: ', name(.))" /></xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Object description //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="desc" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Title and description //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Title is ignored and desc is converted to Tag in the mode="desc" template
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'title' or name(.) = 'desc']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Symbols //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'symbol']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Use //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Could be implemented via librairies
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico (but since it is not supported by Inkscape, not implemented yet)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'use']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // RDF and foreign objects //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="rdf:RDF | *[name(.) = 'foreignObject']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Misc ignored stuff (markers, patterns, styles) //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'marker' or name(.) = 'pattern' or name(.) = 'style']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Colors and patterns //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Generic color template
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Object opacity
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Fill
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Fill opacity
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Fill rule
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Generic fill template
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke opacity
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Generic stroke template
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke width
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke mitterlimit
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke dasharray (not supported in FXG)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke dashoffset (not supported in FXG)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Linejoin SVG to FxG converter
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke linejoin
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Linecap SVG to FXG converter
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Stroke linecap
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Gradient stop
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Gradient stop opacity
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Gradient stop offset
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Generic color template //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="colorspec" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and not(contains($colorspec , '%'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="'#'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after($colorspec, 'rgb('), ',')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), ',')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($colorspec, 'rgb(') and contains($colorspec , '%')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="'#'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="number(substring-before(substring-after($colorspec, 'rgb('), '%,')) * 255 div 100" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="number(substring-before(substring-after(substring-after($colorspec, 'rgb('), ','), '%,')) * 255 div 100" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="number(substring-before(substring-after(substring-after(substring-after($colorspec, 'rgb('), ','), ','), '%)')) * 255 div 100" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($colorspec, '#')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="'#'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="string-length(substring-after($colorspec, '#')) = 3">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="colorspec3">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="concat(substring($colorspec3, 1, 1), substring($colorspec3, 1, 1))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="concat(substring($colorspec3, 2, 1), substring($colorspec3, 2, 1))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="concat(substring($colorspec3, 3, 1), substring($colorspec3, 3, 1))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="translate(substring-after($colorspec, '#'), 'abcdefgh', 'ABCDEFGH')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="named_color_hex" select="document('colors.xml')/colors/color[@name = translate($colorspec, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]/@hex" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$named_color_hex and $named_color_hex != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="'#'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after($named_color_hex, '#')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$colorspec" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Object opacity //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="object_opacity" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@opacity or (@style and (contains(@style, ';opacity:') or starts-with(@style, 'opacity:')))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, ';opacity:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, ';opacity:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Opacity, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and starts-with(@style, 'opacity:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'opacity:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Opacity, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="parent::*" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>1</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alpha">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value &lt; 0">0</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value &gt; 1">1</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$value" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Fill //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="fill" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@fill">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@fill" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'fill:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Fill" select="normalize-space(substring-after(@style, 'fill:'))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Fill, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Fill, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Fill" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Removes unwanted characters in the color link (TODO: export to a specific template)-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="normalize-space(translate($value, '&quot;', ''))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Fill opacity //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="fill_opacity" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@fill-opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@fill-opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'fill-opacity:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'fill-opacity:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Opacity, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill_opacity" select="parent::*" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>1</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value &lt; 0">0</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value &gt; 1">1</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$value" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Fill rule //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="fill_rule" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@fill-rule and (@fill-rule = 'nonzero' or @fill-rule = 'evenodd')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@fill-rule = 'nonzero'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">nonZero</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@fill-rule = 'evenodd'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">evenOdd</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'fill-rule:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="FillRule" select="normalize-space(substring-after(@style, 'fill-rule:'))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($FillRule, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="substring-before($FillRule, ';') = 'nonzero'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">nonZero</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="substring-before($FillRule, ';') = 'evenodd'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">evenOdd</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$FillRule = 'nonzero'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">nonZero</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test=" $FillRule = 'evenodd'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">evenOdd</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill_rule" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="winding">nonZero</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Generic fill template //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="template_fill" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="fill"><xsl:apply-templates mode="fill" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="fill_opacity"><xsl:apply-templates mode="fill_opacity" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$fill != '' and $fill != 'none' and not(starts-with($fill, 'url(#'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Solid color -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <SolidColor>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$fill" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alpha">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$fill_opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </SolidColor>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Gradients -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="starts-with($fill, 'url(#')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=substring-before(substring-after($fill, 'url(#'), ')')]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="name(.) = 'linearGradient'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <LinearGradient>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linearGradient" >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after($fill, 'url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </LinearGradient>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="name(.) = 'radialGradient'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <RadialGradient>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="radialGradient" >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after($fill, 'url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </RadialGradient>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$fill = 'none'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <SolidColor color="#ffffff" alpha="1"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stroke">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stroke" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stroke:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Stroke" select="normalize-space(substring-after(@style, 'stroke:'))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Stroke, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Stroke, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$Stroke">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Stroke" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stroke" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke opacity //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_opacity" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stroke-opacity"><xsl:value-of select="@stroke-opacity" /></xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stroke-opacity:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'stroke-opacity:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Opacity, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stroke_opacity" select="parent::*" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>1</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value &lt; 0">0</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value &gt; 1">1</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$value" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Generic stroke template //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported in FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * stroke-dasharray
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * stroke-dashoffset
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="template_stroke" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stroke"><xsl:apply-templates mode="stroke" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stroke_opacity"><xsl:apply-templates mode="stroke_opacity" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stroke_width"><xsl:apply-templates mode="stroke_width" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stroke_miterlimit"><xsl:apply-templates mode="stroke_miterlimit" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stroke_linejoin"><xsl:apply-templates mode="stroke_linejoin" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stroke_linecap"><xsl:apply-templates mode="stroke_linecap" select="." /></xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Solid color -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$stroke != '' and $stroke != 'none' and not(starts-with($stroke, 'url(#'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <stroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <SolidColorStroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alpha">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="weight">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$stroke_miterlimit != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="miterLimit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_miterlimit" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="joints">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_linejoin" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="caps">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_linecap" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </SolidColorStroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </stroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Gradients -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="starts-with($stroke, 'url(#')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:for-each select="//*[@id=substring-before(substring-after($stroke, 'url(#'), ')')]">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="name(.) = 'linearGradient'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <stroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <LinearGradientStroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="weight">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$stroke_miterlimit != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="miterLimit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_miterlimit" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="joints">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_linejoin" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="caps">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_linecap" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linearGradient" >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after($stroke, 'url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </LinearGradientStroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </stroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="name(.) = 'radialGradient'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <stroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <RadialGradientStroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="weight">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$stroke_miterlimit != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="miterLimit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_miterlimit" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="joints">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_linejoin" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="caps">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stroke_linecap" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="radialGradient" >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="id">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after($stroke, 'url(#'), ')')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </RadialGradientStroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </stroke>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:for-each>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke width //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_width" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stroke-width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stroke-width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stroke-width:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains(substring-after(@style, 'stroke-width:'), ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'stroke-width:'), ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after(@style, 'stroke-width:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stroke_width" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>1</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke miterlimit //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Probably not calculated the same way in SVG and FXG (same value but different result)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_miterlimit" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stroke-miterlimit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stroke-miterlimit" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stroke-miterlimit:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="miterLimit" select="substring-after(@style, 'stroke-miterlimit:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($miterLimit, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($miterLimit, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$miterLimit" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stroke_miterlimit" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke dasharray //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico !! Not supported !!
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_dasharray" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment>FXG does not support dasharrays</xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke dashoffset //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico !! Not supported !!
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_dashoffset" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment>FXG does not support dashoffsets</xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Linejoin SVG to FXG converter //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="linejoin_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="linejoin" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$linejoin = 'bevel'">bevel</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$linejoin = 'round'">round</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>miter</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke linejoin //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_linejoin" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stroke-linejoin">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linejoin_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="linejoin">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stroke-linejoin" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stroke-linejoin:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="joints" select="substring-after(@style, 'stroke-linejoin:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($joints, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linejoin_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="linejoin">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($joints, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linejoin_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="linejoin">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$joints" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stroke_linejoin" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>miter</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Linecap SVG to FXG converter //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported in FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * butt linecap
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template name="linecap_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:param name="linecap" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$linecap = 'round'">round</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$linecap = 'square'">square</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$linecap = 'butt'">round</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>none</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Stroke linecap //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stroke_linecap" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stroke-linecap">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linecap_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="linecap">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stroke-linecap" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stroke-linecap:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="caps" select="substring-after(@style, 'stroke-linecap:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($caps, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linecap_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="linecap">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($caps, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="linecap_svg_to_fxg">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="linecap">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$caps" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stroke_linecap" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>none</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Gradient stops //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stop_color" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stop-opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stop-opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="temp_opacity" select="substring-after(@style, 'stop-opacity:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($temp_opacity, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($temp_opacity, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$temp_opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise><xsl:value-of select="''" /></xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="hex_opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$Opacity != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="to_hex">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="number($Opacity) * 255" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="stopcolor">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stop-color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stop-color" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stop-color:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Color" select="normalize-space(substring-after(@style, 'stop-color:'))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Color, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Color, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Color" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stop_color" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>#000</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$stopcolor" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$Opacity != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alpha">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Gradient stop opacity //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="stop_opacity" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@stop-opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="Opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@stop-opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'stop-opacity:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Opacity" select="substring-after(@style, 'stop-opacity:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Opacity, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Opacity, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stop_opacity" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Gradient stop offset //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="offset" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@offset">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="ratio">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains(@offset, '%')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="number(substring-before(@offset, '%')) div 100" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@offset" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@style and contains(@style, 'offset:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="Offset" select="substring-after(@style, 'offset:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="ratio">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Offset, '%')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="number(substring-before($Offset, '%')) div 100" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($Offset, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($Offset, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$Offset" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="name(..) = 'g' or name(..) = 'svg'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="stop_offset" select="parent::*"/>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text specific templates //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text tspan
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text flowPara
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text flowRegion (text frame)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Font size
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Font weight
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Font family
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Font style
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Baseline shift
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Line height
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Writing mode
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text decoration
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Text fill
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text direction
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text size
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text position
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Text object
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * FlowRoot object
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text span //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: tspan, flowSpan, FXG: span
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported in FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * span position
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'tspan' or name(.) = 'flowSpan']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <span>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="../@xml:space='preserve'">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="whiteSpaceCollapse">preserve</xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="fill">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="fill_opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$fill" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="textAlpha">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$fill_opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="font_size" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_weight" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_family" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_style" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="text_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_decoration" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="line_height" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="baseline_shift" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="text()">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="text()" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </span>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text flowPara //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: flowPara, flowDiv FXG: p
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported in FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * paragraph position
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'flowPara' or name(.) = 'flowDiv']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <p>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="../@xml:space='preserve'">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="whiteSpaceCollapse">preserve</xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="fill">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="fill_opacity">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="template_color">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="colorspec">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$fill" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:with-param>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="textAlpha">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$fill_opacity" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="font_size" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_weight" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_family" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_style" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="text_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_decoration" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="line_height" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="baseline_shift" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="*[name(.) = 'flowSpan']/text()">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@xml:space='preserve'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="translate(text(), '&#x9;&#xA;&#xD;', ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="normalize-space(translate(text(), '&#x9;&#xA;&#xD;', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </p>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text flowRegion //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="flow_region" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_size" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_position" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text font size //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: font-size, FXG: fontSize
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="font_size" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@font-size">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@font-size" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'font-size:')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="font_size" select="normalize-space(substring-after(@style, 'font-size:'))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains($font_size, ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before($font_size, ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="$font_size" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="fontSize">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="$value" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<!--
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico // Text font weight //
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico SVG: font-weight, FXG: fontWeight
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico-->
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:template mode="font_weight" match="*">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="value">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@font-weight">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="@font-weight" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@style and contains(@style, 'font-weight:')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="font_weight" select="normalize-space(substring-after(@style, 'font-weight:'))" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="contains($font_weight, ';')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="substring-before($font_weight, ';')" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$font_weight" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:variable>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="$value != ''">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="fontWeight">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="$value='normal' or $value='bold'">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$value" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="$value &lt; 500 or $value = 'lighter'">normal</xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="$value &gt; 499 or $value = 'bolder'">bold</xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:otherwise>normal</xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico</xsl:template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<!--
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico // Text font family //
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico SVG: font-family, FXG: fontFamily
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico-->
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:template mode="font_family" match="*">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="value">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@font-family">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="translate(@font-family, &quot;'&quot;, '')" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@style and contains(@style, 'font-family:')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="font_family" select="normalize-space(substring-after(@style, 'font-family:'))" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="contains($font_family, ';')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="translate(substring-before($font_family, ';'), &quot;'&quot;, '')" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="translate($font_family, &quot;'&quot;, '')" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:variable>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="$value != ''">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="fontFamily">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="$value='Sans'">Arial</xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$value" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico</xsl:template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<!--
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico // Text font style //
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico SVG: font-style, FXG: fontStyle
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico-->
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:template mode="font_style" match="*">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="value">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@font-style">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="@font-style" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@style and contains(@style, 'font-style:')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="font_style" select="normalize-space(substring-after(@style, 'font-style:'))" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="contains($font_style, ';')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="substring-before($font_style, ';')" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$font_style" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:variable>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="$value != ''">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="fontStyle">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$value" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico</xsl:template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text baseline shift //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: baseline-shift, FXG: baselineShift
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="baseline_shift" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@baseline-shift">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@baseline-shift" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'baseline-shift:') and not(contains(substring-after(@style, 'baseline-shift:'), ';'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after(@style, 'baseline-shift:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'baseline-shift:') and contains(substring-after(@style, 'baseline-shift:'), ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'baseline-shift:'), ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="baselineShift">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='baseline'">0</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='super'">superscript</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='sub'">subscript</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="translate($value, '%', '') &lt; -1000">-1000</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="translate($value, '%', '') &gt; 1000">1000</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="translate($value, '%', '')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="contains($value, '%')">%</xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<!--
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico // Text line height //
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico SVG: line-height, FXG: lineHeight
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico-->
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:template mode="line_height" match="*">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="value">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@line-height">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="@line-height" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="@style and contains(@style, 'line-height:')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="line_height" select="normalize-space(substring-after(@style, 'line-height:'))" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:when test="contains($line_height, ';')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="substring-before($line_height, ';')" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:when>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$line_height" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:otherwise>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:choose>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:variable>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="$value != ''">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="lineHeight">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:call-template name="convert_unit">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:with-param name="convert_value" select="$value" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:call-template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico</xsl:template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text writing mode //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: writing-mode, FXG: blockProgression
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Values inverted in FXG...
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="writing_mode" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@writing-mode">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@writing-mode" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'writing-mode:') and not(contains(substring-after(@style, 'writing-mode:'), ';'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after(@style, 'writing-mode:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'writing-mode:') and contains(substring-after(@style, 'writing-mode:'), ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'writing-mode:'), ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="blockProgression">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='tb'">rl</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>tb</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value='tb'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="textRotation">rotate270</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text decoration //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: text-decoration, FXG: textDecoration, lineThrough
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="text_decoration" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@text-decoration">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@text-decoration" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'text-decoration:') and not(contains(substring-after(@style, 'text-decoration:'), ';'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after(@style, 'text-decoration:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'text-decoration:') and contains(substring-after(@style, 'text-decoration:'), ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'text-decoration:'), ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value != ''">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='underline'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="textDecoration">underline</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='line-through'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="lineThrough">true</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<!--
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico // Text fill //
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico SVG: fill, fill-opacity, FXG: color, textAlpha
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico-->
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<xsl:template mode="text_fill" match="*">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="fill">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="fill" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:variable>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:variable name="fill_opacity">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="fill_opacity" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:variable>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="starts-with($fill, '#') or (not(starts-with($fill, 'url')) and $fill != '' and $fill != 'none')">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="color">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:call-template name="template_color">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:with-param name="colorspec">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$fill" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:with-param>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:call-template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="textAlpha">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:value-of select="$fill_opacity" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico</xsl:template>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text direction //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: direction, unicode-bidi, FXG: direction
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="direction" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="value">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@direction">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@direction" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'direction:') and not(contains(substring-after(@style, 'direction:'), ';'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after(@style, 'direction:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'direction:') and contains(substring-after(@style, 'direction:'), ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'direction:'), ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="bidi">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@unicode-bidi">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@unicode-bidi" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'unicode-bidi:') and not(contains(substring-after(@style, 'unicode-bidi:'), ';'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-after(@style, 'unicode-bidi:')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@style and contains(@style, 'unicode-bidi:') and contains(substring-after(@style, 'unicode-bidi:'), ';')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="substring-before(substring-after(@style, 'unicode-bidi:'), ';')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="$value != '' and ($bidi='embed' or $bidi='bidi-override')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="direction">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='ltr'">ltr</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$value='rtl'">rtl</xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text size //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="text_size" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text position //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="text_position" match="*">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Keep the first x value only -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains(@x, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="substring-before(@x, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Keep the first y value only -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="contains(@y, ' ')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="substring-before(@y, ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Text objects //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: text, FXG: RichText
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported by FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Generic fonts.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Embedded fonts (in defs).
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Character rotation.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Character positionning (x and y).
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text-anchor.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text stroke.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Partial support:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Text rotation (0, 90, 180 and 270 degrees only) -> not implemented.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Font weight (normal and bold only) -> values under 500 are considered normal, the others bold.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Whitespace handling, issues with xml:whitespace='preserve'.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'text']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <RichText>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Force default baseline to "ascent" -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alignmentBaseline">ascent</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_size" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_weight" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_family" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_style" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="text_fill" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="text_decoration" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="line_height" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_size" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_position" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="direction" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="writing_mode" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:if test="not(*[name(.) = 'tspan']/text())">
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:attribute name="whiteSpaceCollapse">preserve</xsl:attribute>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico </xsl:if>
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--xsl:apply-templates mode="forward" /-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <content>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="*[name(.) = 'tspan']/text()">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@xml:space='preserve'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="translate(text(), '&#x9;&#xA;&#xD;', ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="normalize-space(translate(text(), '&#x9;&#xA;&#xD;', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </content>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </RichText>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // FlowRoot objects //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: flowRoot, FXG: RichText
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported by FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * See text objects
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'flowRoot']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <RichText>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Force default baseline to "ascent" -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="alignmentBaseline">ascent</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_size" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_weight" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_family" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="font_style" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="text_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="text_decoration" select="." />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico <xsl:apply-templates mode="line_height" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="direction" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="writing_mode" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="flow_region" select="*[name(.) = 'flowRegion']/child::node()" />
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <content>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="*[name(.) = 'flowPara' or name(.) = 'flowDiv']/text()">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@xml:space='preserve'">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="translate(text(), '&#x9;&#xA;&#xD;', ' ')" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="normalize-space(translate(text(), '&#x9;&#xA;&#xD;', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </content>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </RichText>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico<!--
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico // Shapes //
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Lines
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Rectangle
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Path
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Ellipse
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Circle
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Image
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Polygon (not supported)
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico * Polyline (not supported)
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico-->
935223f1795ae0522a4e4c26b89ee9b7a1d2d5a8JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Line object //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: line, FXG: Line
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'line']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Line>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x1">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="xFrom">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x1" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y1">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="yFrom">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y1" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x2">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="xTo">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x2" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y2">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="yTo">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y2" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Line>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Rectangle object //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: rect, FXG: Rect
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'rect']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@rx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="radiusX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@rx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@ry">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="radiusY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@ry" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@rx and not(@ry)">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="radiusX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@rx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="radiusY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@rx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@ry and not(@rx)">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="radiusX">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@ry" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="radiusY">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="@ry" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- <xsl:apply-templates mode="resources" select="." /> -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Path //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: path, FXG: Path
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported by FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * elliptical arc curve commands (workaround: convert to path first)
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico TODO:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Implement an arc to curve convertor
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'path']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Path>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Path element -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Exclude arcs in order to prevent the mxml compiler from failing -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@d and not(contains(@d, 'a') or contains(@d, 'A'))">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="data">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select="normalize-space(translate(@d , ',', ' '))" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="fill_rule" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Child elements -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Path>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="contains(@d, 'a') or contains(@d, 'A')">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment><xsl:value-of select="'Elliptic arc command in path data not supported, please convert to path (arcs are thus converted to curves) before exporting.'" /></xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Ellipse object //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: ellipse, FXG: Ellipse
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'ellipse']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Ellipse>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="cx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@cx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@cx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="cy">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@cy">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@cy" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="rx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@rx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@rx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="ry">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@ry">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@ry" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$rx != 0">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cx - $rx, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number(2 * $rx, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cx, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">0</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$ry != 0">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cy - $ry, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number(2 * $ry, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cy, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">0</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Child elements -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Ellipse>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Circle object //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: circle, FXG: Ellipse
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'circle']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Ellipse>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="cx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@cx">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@cx" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="cy">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@cy">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@cy" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="r">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@r">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@r" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>0</xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="$r != 0">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cx - $r, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cy - $r, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number(2 * $r, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number(2 * $r, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cx, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:value-of select='format-number($cy, "#.#")' />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">0</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">0</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <!-- Child elements -->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_fill" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="template_stroke" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="filter_effect" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Ellipse>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Image objects //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico SVG: image, FXG: Rect+BitmapFill
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico Not supported by FXG:
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Embedded images (base64).
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico * Preserve ratio.
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'image']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="x">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@x" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="y">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@y" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="width">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@width" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="height">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="convert_unit">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="convert_value" select="@height" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="object_opacity" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="id" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="desc" select="." />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:if test="@xlink:href">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <BitmapFill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:attribute name="source">@Embed('<xsl:value-of select="@xlink:href"/>')</xsl:attribute>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </BitmapFill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </fill>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:if>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="forward" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Rect>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="clipped_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'clip'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:variable name="masked_object">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:apply-templates mode="clip" select="." >
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$clipped_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="clip_type" select="'mask'" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:apply-templates>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:variable>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:when test="@transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:call-template name="object_transform">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="object" select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:with-param name="transform" select="@transform" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:call-template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </Group>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:when>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:copy-of select="$masked_object" />
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:otherwise>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico </xsl:choose>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Polygon object //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico !! Not supported !!
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'polygon']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment>FXG does not support polygons</xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<!--
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico // Polyline object //
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico !! Not supported !!
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico-->
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico<xsl:template mode="forward" match="*[name(.) = 'polyline']">
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico <xsl:comment>FXG does not support polylines</xsl:comment>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:template>
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico
a50cc8bbbe8e247c5a01262065298bc99784f687JazzyNico</xsl:stylesheet>