OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] gentext problem


Thank you for your help.
Your example did the trick. I only had to extend the selection on the xml:lang attribute. 
This templete generates HTML files with navigation tabs (which contain table of contents, search form and index). So there is actually no node processed regarding the DocBook source files.

<xsl:if test="$generate.webhelp.index != 0">
  <td>
    <a href="#" rel="tab3" id="t3">
      <img src="images/iview.gif"/>
      <xsl:call-template name="gentext">
        <xsl:with-param name="key" select="'index'"/>
        <xsl:with-param name="lang">
          <xsl:call-template name="l10n.language">
            <xsl:with-param name="target" select="/*[@xml:lang]"/>
          </xsl:call-template>
        </xsl:with-param>
      </xsl:call-template>
    </a>
  </td>
</xsl:if>

Pavel Škopík

-----Original Message-----
From: Jirka Kosek [mailto:jirka@kosek.cz] 
Sent: Thursday, November 13, 2008 12:32 PM
To: Skopik Pavel
Cc: docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] gentext problem

Skopik Pavel wrote:

> I want to use gentext for generating localized name strings for navigation tabs in our web help. For now it applies only to index tab. 
> In my stylesheet I use this template call to generate approriate language string for index. 
> <xsl:if test="$generate.webhelp.index != 0">
>   <td>
>     <a href="#" rel="tab3" id="t3">
>       <img src="images/iview.gif"/>
>       <xsl:call-template name="gentext">
>         <xsl:with-param name="key" select="'index'" />
>       </xsl:call-template>
>     </a>
>   </td>
> </xsl:if>
>  
> Nevertheless I do not get string for index in Czech but rather in English. 

What is the current node for this piece of XSLT? gentext template
computes language for the current node, when there is no current node or
it is "wrong" you will get default language (en). You can try something
like:

<xsl:call-template name="gentext">
  <xsl:with-param name="key" select="..."/>
  <xsl:with-param name="lang">
    <xsl:call-template name="l10n.language">
       <xsl:with-param name="target" select="/"/> <!-- or any other
expression which will return node which has proper language set or
inherited -->
    </xsl:call-template>
  </xsl:with-param>
</xsl:call-template>


-- 
------------------------------------------------------------------
  Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
  Profesionální školení a poradenství v oblasti technologií XML.
       Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
                   Nejbližší termíny školení:
       ** XSLT 16.-19.9.2008 ** XML schémata 21.-23.10. **
    ** XSL-FO 18.-19.11.2008 ** XML pro vývojáře 16.-18.12. **
------------------------------------------------------------------
  http://docbook.cz    Stránky o dokumentačním formátu DocBook
  http://xmlguru.cz    Blog mostly about XML for English readers
------------------------------------------------------------------



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]