RE: [docbook-apps] Author name in header or footer

From
"Dompagnon Dhristopher"
Date
2009-06-29T13:57:49+00:00
ID
Thread
RE: [docbook-apps] Author name in header or footer
Hi !

 

Thank you for this tip but I find it
with no elegance and simplicity.

 

Cordialement,

____________________________________________

Christopher COMPAGNON

AXA GROUP SOLUTIONS - Procurement, BI Supply

Département Solutions
Business Intelligence

Domaine BI France - Reporting Opérationnel

(  01 44 45 04 16 (55 04
16) 

E-mail: 

____________________________________________

Pensez à l'environnement avant d'imprimer ce message

 

De : Damon Mannion
[mailto:] 

Envoyé : dimanche 28 juin
2009 18:25

À : Compagnon Christopher

Cc : 

Objet : Re: [docbook-apps]
Author name in header or footer

 

Hi

 

You may find the code below helpful.

 

The mistakes I made in getting this to work was:

- not setting the namespace correctly

- not setting up default handling for the book meta data

 

Damon

 

<!--********

  document meta data
element handling

  

  With the way docbook is
structured, default handling for all book meta data is explicitly switched off,

  this is to stop
accidental processing. It is switched on for <date> because that element
is used across the

  document. However (say)
<legalnotice> is not handled. The solution is to created a new mode for
the titlepage

  template, then apply
the usual processing. If this is not here, compile errors and generated. If you
use

  xsl-value, then you
only get the text appearing, and not the processing of the embedded trademark
element

  within legalnotice.
Hence this needs to be here.

********-->

<xsl:template
match="/d:book/d:info/d:legalnotice"
mode="book.titlepage.footer">

  <xsl:apply-templates
/>

</xsl:template>

 

 

<!--********

  footer content

********-->

<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="''"/>

 

            <fo:block>       

 

                        <xsl:if
test="not ($pageclass = 'coversequence' and $sequence = 'first')">

 

                                   <xsl:choose>

 

                                               <xsl:when
test="$position = 'left'">       

                                                           <xsl:apply-templates
select="/d:book/d:info/d:date"/>

                                                           <fo:block/>

                                                           <xsl:text>v:
</xsl:text>

                                                           <xsl:apply-templates
select="/d:book/d:info/d:revhistory/d:revision[last()]/d:revnumber"/>

                                               </xsl:when>

 

                                               <xsl:when
test="$position = 'center'">

                                                           <xsl:apply-templates
select="/d:book/d:info/d:legalnotice"
mode="book.titlepage.footer"/>

                                                           <fo:block/>

                                                           <xsl:apply-templates
select="/d:book/d:info/d:copyright"
mode="titlepage.mode"/>

                                               </xsl:when>

 

                                               <xsl:when
test="$position = 'right'">

                                                           <xsl:text>Page:
</xsl:text>

                                                           <fo:page-number/>

                                               </xsl:when>                                         

 

                                   </xsl:choose>

 

                        </xsl:if>

 

            </fo:block>

 

</xsl:template>

 

 

 

On 26 Jun 2009, at 15:34, Compagnon Christopher wrote:

Hi,

 

I would like to
produce a PDF file with docbook-xsl fo stylesheets with authorname in header or
footer. All examples I find on the web don’t work.

And the same question
with the book’s title.

 

Cordialement,

<image001.jpg>

____________________________________________

Christopher COMPAGNON

AXA GROUP SOLUTIONS - Procurement, BI Supply

Département Solutions Business
Intelligence

Domaine BI France - Reporting Opérationnel

(  01 44 45 04 16 (55
04 16)

E-mail: 

____________________________________________

<image002.jpg>Pensez
à l'environnement avant d'imprimer ce message