#1279 Rework of gentext.template in 1.76.0 broke custom contexts

output: all formats
XSL (1066)

I am currently upgrading from 1.75.2 to latest release, 1.78.0, and the gentext.template template broke for me. The reason is, I use custom context to provide localization for some non-standard context, for example "Run-in text for admonitions" as follows:

<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="admon-run-in">
<l:template name="note" text="Note:&#160;"/>
<l:template name="caution" text="Caution!&#160;"/>

This context is used in customization templates:

<xsl:call-template name="gentext.template">
<xsl:with-param name="context">admon-run-in</xsl:with-param>
<xsl:with-param name="name" select="local-name(.)"/>

This works fine with 1.75.2. However, starting with 1.76.0, the gentext.template template was modified as follows:

<xsl:variable name="local.template.node" .../>
<xsl:for-each select="$context.node">
<xsl:when test="$local.template.node/@text">
<xsl:value-of select="$local.template.node/@text"/>

This change broke such "custom" contexts for l10n, as in such custom context $context.node is an empty nodeset (that is, there is no "default" string for this template). Therefore, the xsl:for-each loop is not executed at all and the local value is not returned by template even though it is defined.

The attached patch restores pre-1.76.0 behavior: first check if text from $local.template.node is available and perform xsl:for-each only if no local template is available.


  • Alexey Neyman

    Alexey Neyman - 2012-12-30

    Patch to restore gentext.template handling of custom contexts

  • Alexey Neyman

    Alexey Neyman - 2013-01-16

    Is this bug tracker alive?

  • Jirka Kosek

    Jirka Kosek - 2013-01-22

    Please test if it works for you.

  • Jirka Kosek

    Jirka Kosek - 2013-01-22
    • assigned_to: nobody --> kosek
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks