27.04.2020 18:04, Tom Lane wrote:
> Alexander Lakhin <exclus...@gmail.com> writes:
>> 26.04.2020 22:13, Tom Lane wrote:
>> BTW, I tried to also use this <phrase> markup inside the template for
>> <returnvalue>, so we'd only need one font-switching special case not two.
>> Didn't work though --- apparently templates don't get applied recursively?
>> Oh well.
We can have a single template "symbol_font" and reuse it, but it doesn't
seem cleaner to me (for just two cases).
(Placing <phrase ...>  into <xsl:template match="returnvalue"> wouldn't
work as such a content goes into the output, whilst all xsl:templates
apply to the input tree.)

Best regards,
Alexander
diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index 2f2517d8ce..38c96737d5 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -92,7 +92,7 @@
 <!-- overrides stylesheet-common.xsl -->
 <!-- FOP needs us to be explicit about the font to use for right arrow -->
 <xsl:template match="returnvalue">
-  <fo:inline font-family="{$symbol.font.family}">&#x2192; </fo:inline>
+  <xsl:call-template name="symbol_font"><xsl:with-param name="content" select="'&#x2192; '"/></xsl:call-template>
   <xsl:call-template name="inline.monoseq"/>
 </xsl:template>
 
@@ -102,8 +102,9 @@
 </xsl:template>
 
 <!-- FOP needs us to be explicit about use of symbol font in some cases -->
-<xsl:template match="phrase[@role='symbol_font']">
-  <fo:inline font-family="{$symbol.font.family}"><xsl:value-of select="."/></fo:inline>
+<xsl:template name="symbol_font" match="phrase[@role='symbol_font']">
+  <xsl:param name="content" select="."/>
+  <fo:inline font-family="{$symbol.font.family}"><xsl:value-of select="$content"/></fo:inline>
 </xsl:template>
 
 <!-- bug fix from <https://sourceforge.net/p/docbook/bugs/1360/#831b> -->

Reply via email to