Home Forums General XMetaL Discussion Generate date at PDF output footer Reply To: Generate date at PDF output footer

Chris

Reply to: Generate date at PDF output footer

Hi Itsme,

XSL isn't very good at dates and times, so the nice people at http://www.exslt.org/ have created some XSL extension functions, including those for date and time. The DITA Open Toolkit already uses some of the exslt.org extension functions, so all you have to do is add the reference to the dates-and-times library, and then use the function.

You'll need to modify your [customization]/fo/xsl/custom.xsl file:

1. Add a refernce to the exslt.org dates-and-times library (changes in bold):


    xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”
    xmlns:fo=”http://www.w3.org/1999/XSL/Format”
    xmlns:exsl=”http://exslt.org/common”
    xmlns:opentopic=”http://www.idiominc.com/opentopic”
    xmlns:exslf=”http://exslt.org/functions”
    xmlns:opentopic-func=”http://www.idiominc.com/opentopic/exsl/function”
    extension-element-prefixes=”exsl date
    exclude-result-prefixes=”opentopic exslf opentopic-func”
    xmlns:date=”http://exslt.org/dates-and-times”
    version=”1.1″>

2. Create a variable to be used by your footer template:



 

3. Add the $footerDate variable to your footer template(s);
e.g. for PDF3 (XMetaL Enhanced PDF), to change the footer on odd-numbered pages, you need to override the __body__odd__footer__* parameters from [customization]/fo/xsl/xm_static_content.xsl:



1 1 1

no-op

This will put the string “2009-01-16T11:40:40-08:00” into your footer.

For more info on the date functions, see:

http://saxon.sourceforge.net/saxon6.5.3/extensions.html

http://www.exslt.org/date/functions/date-time/index.html

HTH,

Chris

Reply

Products
Downloads
Support