summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-06-20 23:22:27 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-06-22 16:59:39 +0200
commit893489db23d56977dbc9f775ffdad9f83a5cde40 (patch)
tree4ec409c811d169d85a11a15e41868ec68a99ae92
parentccf60dc3e77793c242a6188fe18e4faa7f2aa469 (diff)
combine switch and switchinline template rules
Change-Id: I4436c0da1b0443ab9e699aac75122368db8ab5a5 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/136198 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r--help3xsl/online_transform.xsl66
1 files changed, 7 insertions, 59 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 3d6ba73877..fa28ad0ffa 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -657,19 +657,14 @@
</xsl:template>
-<!-- SWITCH -->
-<xsl:template match="switch">
+<!-- SWITCH and SWITCHINLINE -->
+<xsl:template match="switch|switchinline">
<xsl:variable name="idsw">
<xsl:value-of select="//meta/topic/@id" /><xsl:number level="any" count="switch|switchinline" format="_1"/>
</xsl:variable>
<xsl:choose>
- <xsl:when test ="@select = 'sys'">
- <span id="swlnsys{$idsw}" class="switch">
- <xsl:apply-templates />
- </span>
- </xsl:when>
- <xsl:when test ="@select = 'appl'">
- <span id="swlnappl{$idsw}" class="switch">
+ <xsl:when test ="@select = 'sys' or @select = 'appl'">
+ <span id="swln{@select}{$idsw}" class="{local-name()}">
<xsl:apply-templates />
</span>
</xsl:when>
@@ -678,60 +673,13 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<xsl:template match="switch" mode="embedded">
- <xsl:variable name="idsw">
- <xsl:value-of select="//meta/topic/@id" /><xsl:number level="any" count="switch|switchinline" format="_1"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test ="@select = 'sys'">
- <span id="swlnsys{$idsw}" class="switch">
- <xsl:apply-templates mode="embedded"/>
- </span>
- </xsl:when>
- <xsl:when test ="@select = 'appl'">
- <span id="swlnappl{$idsw}" class="switch">
- <xsl:apply-templates mode="embedded"/>
- </span>
- </xsl:when>
- <xsl:otherwise>
- <p class="debug" dir="auto">Unsupported switch condition.</p>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- SWITCHINLINE -->
-<xsl:template match="switchinline">
+<xsl:template match="switch|switchinline" mode="embedded">
<xsl:variable name="idsw">
<xsl:value-of select="//meta/topic/@id" /><xsl:number level="any" count="switch|switchinline" format="_1"/>
</xsl:variable>
<xsl:choose>
- <xsl:when test ="@select = 'sys'">
- <span id="swlnsys{$idsw}" class="switchinline">
- <xsl:apply-templates />
- </span>
- </xsl:when>
- <xsl:when test ="@select = 'appl'">
- <span id="swlnappl{$idsw}" class="switchinline">
- <xsl:apply-templates />
- </span>
- </xsl:when>
- <xsl:otherwise>
- <p class="debug" dir="auto">Unsupported switch condition.</p>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-<xsl:template match="switchinline" mode="embedded">
- <xsl:variable name="idsw">
- <xsl:value-of select="//meta/topic/@id" /><xsl:number level="any" count="switch|switchinline" format="_1"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test ="@select = 'sys'">
- <span id="swlnsys{$idsw}" class="switchinline">
- <xsl:apply-templates mode="embedded"/>
- </span>
- </xsl:when>
- <xsl:when test ="@select = 'appl'">
- <span id="swln{@select}_{$idsw}" class="switchinline">
+ <xsl:when test ="@select = 'sys' or @select = 'appl'">
+ <span id="swln{@select}{$idsw}" class="{local-name()}">
<xsl:apply-templates mode="embedded"/>
</span>
</xsl:when>