This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Current date?
- From: Stephane Bortzmeyer <bortzmeyer at nic dot fr>
- To: Mailing List <mailinglist dot 01 dot 1 at goolo dot com>
- Cc: Brian Burridge <brian at burridge dot net>, DocBookApps <docbook-apps at lists dot oasis-open dot org>
- Date: Thu, 3 Apr 2003 15:08:30 +0200
- Subject: Re: [docbook-apps] Current date?
- Organization: NIC France
- References: <1048863783.1339.0.camel@mi6.local> <3E8ABFF2.3090009@goolo.com>
On Wed, Apr 02, 2003 at 12:48:18PM +0200,
Mailing List <mailinglist dot 01 dot 1 at goolo dot com> wrote
a message of 30 lines which said:
> * declare this file as an entity:
>
> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "docbookx.dtd" [
> ...
> <!ENTITY timestamp SYSTEM "timestamp.txt">
> ...
> ]>
>
>
> * and use it
> ...
> <pubdate>×tamp;</pubdate>
And to be sure that the timestamp file will be a true reflection of
the reality, use make. Here is an example with GNU make:
# ts = TimeStamp
%.html: %.xml %.ts example.xslt
xsltproc example.xslt example.xml > $@
%.ts: %.xml
ls -l $< | awk '{print $$6 " " $$7 " " $$8}' > $@
# To have a nicer presentation of date, see
# http://developers.cogentrts.com/cogent/prepdoc/pd-latestdate.html
# Replace 'ls -l' by 'date' if you are interested in the
# current date, not in the date of the file.
You can also include the timestamp from from the XSL stylesheet, if
you do not want to bang your authors on the head "Thou shalt include a
<PUBDATE>!!!".
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY timestamp SYSTEM "general.ts">
]>
<xsl:template match="text">
<xsl:apply-templates/>
<xsl:text> </xsl:text>
<xsl:text>The original file was modified on ×tamp;</xsl:text>
</xsl:template>
The Makefile becomes:
%.html: %.xml example.xslt
ls -l $< | awk '{print $$6 " " $$7 " " $$8}' > general.ts
sabcmd example.xslt example.xml > $@
.PHONY: general.ts
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org