This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Customizing book/bookinfo/pubdate
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "Frans Englich" <frans dot englich at telia dot com>, <docbook-apps at lists dot oasis-open dot org>
- Date: Wed, 18 Aug 2004 08:54:35 -0700
- Subject: Re: [docbook-apps] Customizing book/bookinfo/pubdate
- References: <200408181419.38189.frans.englich@telia.com>
The titlepage stuff is processed in a different mode, so that is why your
template isn't getting used. Try changing the first line to:
<xsl:template match="pubdate" mode="titlepage.mode">
The titlepage *info elements are processed in a different mode so they can
be selected from and rearranged, rather than just processed in document
order. You also need to make sure that pubdate is included in the titlepage
elements for your document type, as specified in titlepage.templates.xml.
It is for book and article by default.
You also need to change the second line. That should be xsl:param, not
xsl:with-param. I'm surprised your xslt processor didn't complain.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Frans Englich" <frans.englich@telia.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, August 18, 2004 7:19 AM
Subject: [docbook-apps] Customizing book/bookinfo/pubdate
>
> Hello all,
>
> I'm trying to insert the date of processing into the pubdate tag, but it
> doesn't work as it should:
>
> 1. In /book/bookinfo/ I have the pubdate tag.
>
> 2. In my Makefile I have this:
>
> xsltproc --stringparam processingDate "$(shell date '+%Y/%m')" \
>
> The param is correctly passed into my stylesheet.
>
> 3. The template which is to insert the date, looks like this:
> <xsl:template match="pubdate">
> <xsl:with-param name="date" select="$processingDate"/>
> <xsl:message>Match! pubdate</xsl:message>
> <xsl:value-of select="$date"/>
> </xsl:template>
>
> But it doesn't hit. However, if I put the pubdate in any other arbitrary
> element, such as a sect1, the template matches. I have the same problem
> with /book/bookinfo/title
>
> I guess this is caused by I don't grasp XSL correctly: A docbook template
hits
> pubdate, and then the node(pubdate) is not any longer available in the
> document.
>
> How do I do this customization correctly? Is there some pattern for
overriding
> templates/modifying documents?
>
>
> Cheers,
>
> Frans
>
>
>
>
>
>