This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: I want to have content of <date> element in every chunk
- From: Bob Stayton <bobs at caldera dot com>
- To: dbook at centrum dot cz, docbook at lists dot oasis-open dot org
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Fri, 15 Feb 2002 14:40:47 -0800
- Subject: Re: DOCBOOK: I want to have content of <date> element in every chunk
- References: <20020215201751Z684161-8818+588@mail.centrum.cz>
On Fri, Feb 15, 2002 at 09:17:48PM +0100, dbook@centrum.cz wrote:
> Hello,
>
> I use DocBook + Norman Walsh's XSL stylesheets v1.48 to produce e-
> learning HTML courses. Currently I use stylesheet CHUNK.XSL,
> because I need small HTML pages with header and footer. My
> problem is: How can I put into every chunk (into footer) date,
> which I have already defined in <bookinfo> of document?
> Header/footer of chunks are realized by table, so I put here new
> row with code:
>
> <xsl:value-of select=".//date"/>
>
> But its only put date into first chunk - titlepage.
>
> Date is defined in style TITLEPAGE.XSL:
>
> <xsl:template match="date" mode="titlepage.mode">
> <span class="{name(.)}">
> <xsl:apply-templates mode="titlepage.mode"/>
> <br/>
> </span>
> </xsl:template>
>
> I think problem is that there is text 'mode="titlepage.mode"'.
>
> So I'll probably need to create new template which provide
> generating of date in every chunk.
> I tried to create it directly in CHUNK.XSL, but my experiences
> with programming XSL are insufficient, so it does not work.
>
> If somebody know how put into footer of chunks content of element
> <date> defined in <bookinfo> (or content of other elements),
> please help me.
You can do this using a stylesheet customization file.
See this DocBook FAQ to learn how to customize DocBook XSL:
http://www.dpawson.co.uk/docbook/styling/custom.html#d61e77
For the specifics on customizing the footer, see:
http://www.dpawson.co.uk/docbook/styling/html.html#d64e60
If you follow that FAQ, you'll create a
template named 'user.footer.content', which would
look something like this:
<xsl:template name="user.footer.content">
<div class="footer.date">
<xsl:value-of select="//bookinfo/date" />
</div>
</xsl:template>
You can add other HTML tags if you like.
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
Caldera International, Inc. fax: (831) 429-1887
email: bobs@caldera.com