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] Different values for footer.column.widths on first page and rest of document?


Hi,
It is not possible to do what you want with just stylesheet parameters.  You would 
need to copy the template named 'footer.table' from fo/pagesetup.xsl to your 
customization layer and customize it.  In that template, you will find three calls to 
the template named 'header.footer.width', which is a utility template that extracts 
one of the three number values from the 'footer.column.widths' parameter.

In your customization, you would use an xsl:choose statement to override the numbers 
for your special case.  The 'footer.table' template has three params of its own that 
are populated when it is called.  The template param named 'sequence' will contain a 
value of 'first', 'odd', 'even', or 'blank', depending on the current page.  For 
example, for the first column, use:

<fo:table-column column-number="1">
  <xsl:attribute name="column-width">
    <xsl:choose>
      <xsl:when test="$sequence = 'first'">
        <xsl:text>0</xsl:text>
      <xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="header.footer.width">
          ...
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
</fo:table-column>

Do similar overrides for the other two columns.

The reason you cannot just customize the utility template 'header.footer.width' is 
because it is not passed the 'sequence' param, although it probably should be to 
enable such customization.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Øystein Kleven" <oystein.kleven@active-circle.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, May 24, 2011 10:05 AM
Subject: [docbook-apps] Different values for footer.column.widths on first page and 
rest of document?


> Hi,
> I have managed to implement many customizations to my FO customization layer for PDF 
> output, using Bob Stayton's excellent book and this list as reference.
>
> Now I am stuck on the footers in a doc with <article> as root. I want the footer 
> content on the first (front) page to be different than the rest of the pages, and 
> that I accomplished already (see below).  But for the first page footer to be 
> correctly formatted, I need to use different column widths for it compared to the 
> rest:
>
> First page needs this value: <xsl:param name="footer.column.widths">0 1 
> 0</xsl:param>
> Other pages need this value: <xsl:param name="footer.column.widths">1 1 
> 1</xsl:param>
>
> Is it possible to do this? I am a newbie when it comes to xsl templates and defining 
> parameter values in them, so a bit confused.
>
> This is because I want a legal notice on the front, and name, page number and url on 
> the rest. It works with these template "hacks", except I can't figure out how to get 
> the footer column widths into conditional statements:
>
> <xsl:when test="$sequence = 'first'">
> <xsl:choose>
> <xsl:when test="$double.sided = 0 and $position='left'">
> <!-- <fo:page-number/> -->
> </xsl:when>
> <xsl:when test="$double.sided = 0 and $position = 'center'">
> <fo:block text-align="justify">
> <!-- OKL: Insert legal notice in the footer of the first page -->
> <xsl:apply-templates select="//legalnotice[1]" 
> mode="article.titlepage.recto.auto.mode"/>
> </fo:block>
> </xsl:when>
> </xsl:choose>
> </xsl:when>
>
> (I have customized the title page xsl to make the above work)
> .....
>
> <!-- ********** OKL: Single sided, doc body ***************** -->
> <xsl:when test="$double.sided = 0 and $position='left'">
> <!-- OKL: Insert company name -->
> <xsl:apply-templates select="//corpauthor[1]"/>
> </xsl:when>
>
> <xsl:when test="$double.sided = 0 and $position='center'">
> <!-- OKL: Insert page number -->
> <fo:page-number/>
> </xsl:when>
>
> <xsl:when test="$double.sided = 0 and $position='right'">
> <!-- OKL: Insert url -->
> <xsl:value-of select="'www.xxxxxxxxxx.com'"/>
> </xsl:when>
>
> I am using DocBook 4.5 with XSL/FO version 1.73.2
>
> Thanks for any tips...
>
> -- 
> Øystein Kleven
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
> 



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