cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perry Molendijk" <>
Subject FYI: Date Input Module and date formatting
Date Wed, 07 May 2003 15:38:14 GMT
 For anyone trying to come to grips with input modules. Below is what you
need to do if you want to make the current date in a particular format
available in the sitemap:

in cocoon.xconf look for:

logger="core.modules.input" name="date"/>

and replace it with:

logger="core.modules.input" name="date">
  <format>EEE, MMM d, yyyy</format>
  <long-format>EEE, d MMM yyyy HH:mm:ss Z</long-format>

in the sitemap snippet below is an example of passing the current date as a
parameter to an XSL:

<map:match pattern="**.pdf">
  <map:generate src="xdocs/{1}.xml"/>
  <map:transform src="stylesheets/xmlToFo.xsl">
  <map:parameter name="currentDate" value="{date:format}"/>
  <map:serialize type="fo2pdf"/>

You can replace {date:format} with {date:xxxxx} where xxxxx represents the
name of one of the tags added in cocoon.xconf.
e.g. {date:long-format} will give you a date in "EEE, d MMM yyyy HH:mm:ss Z"

>From an error message I worked that the date input module must somehow use
the SimpleDateFormat, so for more information about the date formats
supported see the Java JDK docs on docs/api/java/text/SimpleDateFormat.html.

Thanks to Christian Haul for getting me on the right track.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message