473,224 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

timestamp with xslt

Hi,

how can I make my XSLT-stylesheet insert a timestamp (date/time) into the
output file ?

Regards
Thomas
Jul 20 '05 #1
4 10279


Thomas Mann wrote:
how can I make my XSLT-stylesheet insert a timestamp (date/time) into the
output file ?


With XSLT 1.0 you need to define a global parameter e.g.
<xsl:param name="now" />
and set that parameter before the transformation. How you set parameters
depends on the XSLT processor you use.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
What about XSLT 2 ? Would that be an easier way to go ?
"Martin Honnen" <ma*******@yahoo.de> schrieb im Newsbeitrag
news:41***********************@newsread4.arcor-online.net...


Thomas Mann wrote:
how can I make my XSLT-stylesheet insert a timestamp (date/time) into the
output file ?


With XSLT 1.0 you need to define a global parameter e.g.
<xsl:param name="now" />
and set that parameter before the transformation. How you set parameters
depends on the XSLT processor you use.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3


Thomas Mann wrote:
What about XSLT 2 ? Would that be an easier way to go ?


XSLT 2.0 and XPath 2.0 are under development, it currently defines
http://www.w3.org/TR/xquery-operator...rrent-dateTime
a function to get at the current dateTime and current date so once XSLT
2.0 and XPath 2.0 are recommendations you are likely able to use those
functions in a stylesheet.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #4
Thomas Mann wrote:
how can I make my XSLT-stylesheet insert a timestamp (date/time) into the
output file ?


With current XSLT processors extension functions are required, for
example with Xalan-J you can use Java methods to format the timestamp:

<xsl:template name="dateformat">
<xsl:param name="dateformat">yyyy-MM-dd'T'HH:mm:ssZ</xsl:param>
<xsl:variable name="tz" select='java:java.util.SimpleTimeZone.new(0,
"GMT+00:00")' />
<xsl:variable name="formatter"
select="java:java.text.SimpleDateFormat.new($datef ormat)"/>
<xsl:variable name="settz" select="java:setTimeZone($formatter, $tz)" />
<xsl:variable name="date" select="java:java.util.Date.new()"/>
<xsl:value-of select="java:format($formatter, $date)" />
</xsl:template>
--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and...
3
by: Michael Hertz | last post by:
I am performing a XSLT stylesheet on a XML document and produce a new XML document. How can I insert in this new XML stylesheet a tag <currtime>..."the current date/time"....</currtime> where...
1
by: Thomas Mann | last post by:
Hello, using XSLT 2.0 I can get a timestamp with the following line: <xsl:value-of select="current-dateTime()"/> How can I format the date and the time ? For example I do not want the...
2
by: rong.guo | last post by:
Hello Group, I am having a really weird problem... Can anyone tell the difference between Query 1 and Query 2 below? Why Query 2 excludes '2/28/2005'? Many thanks! create table a...
6
by: Greg Collins [MVP] | last post by:
For background, please refer to my original thread: http://groups.google.com/groups?selm=efe5w7tYEHA.3112%40tk2msftngp13.phx.gbl I've thought of a potential way around the issue, but I'm new to...
2
by: Zygo Blaxell | last post by:
I have a table with a few million rows of temperature data keyed by timestamp. I want to group these rows by timestamp intervals (e.g. every 32 seconds), compute aggregate functions on the...
2
by: Russell Smith | last post by:
Timestamps support infinity. However if appears dates do not. When timestamps are cast to dates, there is no output. Is this an acceptable option or not? Below are a number of examples...
22
by: Mal Ball | last post by:
I hope I have the right forum for this question. I have an existing Windows application which uses a SQL Server database and stored procedures. I am now developing a web application to use the same...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.