📄 stringtspan.xsl
字号:
<?xml version="1.0" encoding="UTF-8"?><!--Template: StringTSpan.xslSplits a string into tspans--><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/2000/svg" xmlns:UML="org.omg.xmi.namespace.UML"> <xsl:import href="Styling.xsl"/> <xsl:output media-type="image/svg+xml" method="xml" indent="yes"/> <!-- StringTSpan --> <xsl:template name="StringTSpan"> <xsl:param name="SemanticID"/> <xsl:param name="String"/> <xsl:param name="x" select="'0'"/> <xsl:param name="y" select="'0'"/> <xsl:param name="bs" select="0"/> <xsl:choose> <xsl:when test="substring-before($String, '
') or substring-after($String, '
')"> <!-- There are newlines inside this string --> <!-- Show the first line --> <tspan x="{$x}" y="{$y}" baseline-shift="{$bs}%" xml:space="preserve"><xsl:apply-templates select="." mode="FontStyle"/><xsl:if test="key('xmi.id', $SemanticID)/@isAbstract = 'true'"><xsl:attribute name="font-style"><xsl:text>italic</xsl:text></xsl:attribute></xsl:if><xsl:value-of select="substring-before($String, '
')"/></tspan> <!-- And call this template for the rest of the lines --> <xsl:call-template name="StringTSpan"> <xsl:with-param name="SemanticID" select="$SemanticID"/> <xsl:with-param name="String"> <xsl:value-of select="substring-after($String, '
')"/> </xsl:with-param> <xsl:with-param name="x" select="$x"/> <xsl:with-param name="y" select="$y"/> <xsl:with-param name="bs" select="number($bs) - 120" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <!-- A single line --> <tspan x="{$x}" y="{$y}" baseline-shift="{$bs}%" xml:space="preserve"><xsl:apply-templates select="." mode="FontStyle"/><xsl:if test="key('xmi.id', $SemanticID)/@isAbstract = 'true'"><xsl:attribute name="font-style"><xsl:text>italic</xsl:text></xsl:attribute></xsl:if><xsl:value-of select="$String"/></tspan> </xsl:otherwise> </xsl:choose> </xsl:template></xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -