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] Problem adding footer to DocBook Slides


Darya Said-Akbari wrote:

> Is that a wrong approach for the customization layer?

Unfortunatelly yes, your variable is always shadowed by local variable 
with the same name. You must customize template in running.foot.mode. 
For example the following definition will create two line footer with 
slides names, actual foil group name, copyright and number of slide.

<xsl:template match="*" mode="running.foot.mode">
   <xsl:param name="master-reference" select="'unknown'"/>

   <xsl:variable name="last-slide"
                 select="(//foil|//foilgroup)[last()]"/>

   <xsl:variable name="last-id">
     <xsl:choose>
       <xsl:when test="$last-slide/@id">
         <xsl:value-of select="$last-slide/@id"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="generate-id($last-slide)"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>

   <xsl:variable name="content">
     <fo:table table-layout="fixed" width="100%"
               xsl:use-attribute-sets="running.foot.properties">
       <fo:table-column column-number="1" column-width="50%"/>
       <fo:table-column column-number="2" column-width="50%"/>
       <fo:table-body>
         <fo:table-row height="14pt">
           <fo:table-cell text-align="left">
             <fo:block>
               <xsl:if test="self::foil">
                 <xsl:choose>
                   <xsl:when test="ancestor::foilgroup[1]/titleabbrev">
                     <xsl:apply-templates 
select="ancestor::foilgroup[1]/titleabbrev"
                                          mode="titlepage.mode"/>
                   </xsl:when>
                   <xsl:otherwise>
                     <xsl:apply-templates 
select="ancestor::foilgroup[1]/title"
                                          mode="titlepage.mode"/>
                   </xsl:otherwise>
                 </xsl:choose>
               </xsl:if>
             </fo:block>
           </fo:table-cell>
           <fo:table-cell text-align="right">
	    <fo:block>
	      <xsl:choose>
		<xsl:when test="ancestor::slides/slidesinfo/titleabbrev">
		  <xsl:apply-templates select="ancestor::slides/slidesinfo/titleabbrev"
				       mode="titlepage.mode"/>
		</xsl:when>
		<xsl:otherwise>
		  <xsl:apply-templates select="ancestor::slides/slidesinfo/title"
				       mode="titlepage.mode"/>
		</xsl:otherwise>
	      </xsl:choose>
	    </fo:block>
           </fo:table-cell>
         </fo:table-row>
         <fo:table-row height="14pt">
           <fo:table-cell text-align="left">
             <fo:block>
               <xsl:if 
test="ancestor::slides/slidesinfo/releaseinfo[@role='copyright']">
                 <xsl:apply-templates 
select="ancestor::slides/slidesinfo/releaseinfo[@role='copyright']"
                                      mode="value"/>
                 <xsl:text>&#160;&#160;&#160;</xsl:text>
               </xsl:if>
               <xsl:apply-templates 
select="ancestor::slides/slidesinfo/copyright"
                                    mode="titlepage.mode"/>
             </fo:block>
           </fo:table-cell>
           <fo:table-cell text-align="right">
             <fo:block>
	      <xsl:call-template name="foil.number"/>
	      <fo:leader/>
	      <xsl:text>(page </xsl:text>
               <fo:page-number/>
	      <xsl:text>)</xsl:text>
             </fo:block>
           </fo:table-cell>
         </fo:table-row>
       </fo:table-body>
     </fo:table>
   </xsl:variable>

   <fo:static-content flow-name="xsl-region-after-foil">
     <fo:block>
       <xsl:copy-of select="$content"/>
     </fo:block>
   </fo:static-content>

   <fo:static-content flow-name="xsl-region-after-foil-continued">
     <fo:block>
       <xsl:copy-of select="$content"/>
     </fo:block>
   </fo:static-content>
</xsl:template>

<xsl:template name="foil.number">
   <xsl:choose>
     <xsl:when test="self::foil">
       <xsl:number count="foil" level="any" from="slides"/>
       /
       <xsl:value-of select="count(ancestor::slides//foil)"/>
     </xsl:when>
     <xsl:otherwise>
       &#160;
     </xsl:otherwise>
   </xsl:choose>
</xsl:template>


-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
        Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
                    Nejbližší termíny školení:
     ** XSLT 23.-26.10.2006 ** XML schémata 13.-15.11.2006 **
      ** DocBook 11.-13.12.2006 ** XSL-FO 11.-12.12.2006 **
------------------------------------------------------------------
   http://xmlguru.cz    Blog mostly about XML for English readers
------------------------------------------------------------------

S/MIME Cryptographic Signature



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