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


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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

Subject: RE: [docbook] Gentext page pg number formatting

Hi Bob! Thanks for the reply,


Here is an example of one of my “override” xml language files:


<?xml version="1.0" encoding="US-ASCII"?>

<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en" english-language-name="English">

 <l:gentext key="warning" text="WARNING"/>

 <l:gentext key="caution" text="CAUTION"/>

 <l:gentext key="danger" text="DANGER"/>

 <l:gentext key="note" text="Note"/>

 <l:gentext key="TableofContents" text="TABLE OF CONTENTS"/>

 <l:gentext key="tableofcontents" text="Table of Contents"/>

 <l:gentext key="pageof" text=" of "/>

 <l:gentext key="continued" text="Continued"/>

 <l:gentext key="TocPage" text="Page"/>

 <l:gentext key="blank.page.notice" text="This Page Intentionally Left Blank"/>

  <l:gentext key="IMPORTANT" text="IMPORTANT"/>

  <l:gentext key="important" text="Important"/>

  <l:gentext key="Important" text="Important"/>


 <l:context name="title">

   <l:template name="figure" text="Figure&#160;%n"/>


 <l:context name="xref">

   <l:template name="figure" text="Figure&#160;%n"/>




From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Tuesday, September 20, 2005 11:25 AM
To: David White; docbook@lists.oasis-open.org
Subject: Re: [docbook] Gentext page pg number formatting


This looks like it should work, and in fact it does work why I try it.  You didn't include a sample of your locale files.  Do they contain a gentext template for the key 'pageof'?


Bob Stayton
Sagehill Enterprises
DocBook Consulting



----- Original Message -----

From: David White

Sent: Monday, September 19, 2005 9:29 AM

Subject: [docbook] Gentext page pg number formatting


Hello all,


I have a bit of code which is intended to produce “ 1 of XX “ page numbering for out footer.  However, it must use gentext to allow for languages which we translate our book into.


Here is how I pull in the language files:


The start of the XSL file…

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE xsl:stylesheet [

                <!ENTITY da.locale SYSTEM "da_OR.xml">

                <!ENTITY de.locale SYSTEM "de_OR.xml">

                <!ENTITY el.locale SYSTEM "el_OR.xml">

                <!ENTITY en.locale SYSTEM "en_OR.xml">

                <!ENTITY es.locale SYSTEM "es_OR.xml">

                <!ENTITY fi.locale SYSTEM "fi_OR.xml">

                <!ENTITY fr.locale SYSTEM "fr_OR.xml">

                <!ENTITY it.locale SYSTEM "it_OR.xml">

                <!ENTITY nl.locale SYSTEM "nl_OR.xml">

                <!ENTITY no.locale SYSTEM "no_OR.xml">

                <!ENTITY pt.locale SYSTEM "pt_OR.xml">

                <!ENTITY sv.locale SYSTEM "sv_OR.xml">

                <!ENTITY ru.locale SYSTEM "ru_OR.xml">

                <!ENTITY cs.locale SYSTEM "cs_OR.xml">

                <!ENTITY sk.locale SYSTEM "sk_OR.xml">

                <!ENTITY sl.locale SYSTEM "sl_OR.xml">

                <!ENTITY hu.locale SYSTEM "hu_OR.xml">

                <!ENTITY pl.locale SYSTEM "pl_OR.xml">

                <!ENTITY hr.locale SYSTEM "hr_OR.xml">



These are small XML files which contain key words for gentext to use over the standard docbook XSL library of translated words…


This is how Gentext is setup:



<!--  Gentext                                                     -->


                <xsl:param name="local.l10n.xml" select="document('')"/>

                <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">&da.locale;&de.locale;&el.locale;&en.locale;&es.locale;&fi.locale;&fr.locale;&it.locale;&nl.locale;&no.locale;&pt.locale;&sv.locale;



Then, the template im executing:


<xsl:template name="footer.content">

                <xsl:param name="pageclass" select="''"/>

                <xsl:param name="sequence" select="''"/>

                <xsl:param name="position" select="''"/>

                <xsl:param name="gentext-key" select="''"/>

                <xsl:param name="lang"><xsl:call-template name="l10n.language"/></xsl:param>



   <!-- pageclass can be front, body, back -->

   <!-- sequence can be odd, even, first, blank -->

   <!-- position can be left, center, right -->


                <!-- nop; no footer on title pages -->

    <xsl:when test="$pageclass = 'titlepage'"> 



     <xsl:when test="$double.sided != 0 and

                     (($sequence = 'even'

                     and $position='left')


                     (($sequence = 'odd' or $sequence = 'first')

                     and $position='right'))">


         <xsl:attribute name="src">

           <xsl:call-template name="fo-external-image">

             <xsl:with-param name="filename">

               <xsl:call-template name="lang.icon"/>




         <xsl:attribute name="width">0.45in</xsl:attribute>




     <xsl:when test="$double.sided != 0 and

                     (($sequence = 'even'

                     and $position='right')


                     (($sequence = 'odd' or $sequence = 'first')

                     and $position='left'))">

       <xsl:attribute name="font-size">6pt</xsl:attribute>

       <xsl:value-of select="$footer.tag"/>



     <xsl:when test="$double.sided != 0 and $position='center'">


                                <fo:page-number/><xsl:call-template name="gentext.space"/>

                                                <xsl:call-template name="gentext">

                                                                <xsl:with-param name="key" select="'pageof'"/>


                                <xsl:call-template name="gentext.space"/><fo:page-number-citation ref-id="lAsT-pAgE"/>





       <!-- nop -->






The only output I can manage is: “1  22”, it simply ignores the gentext call.  I can replace the gentext with “<xsl:text>of</xsl:text>” and that does render.


Anyone recognize the source of my error?


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