473,670 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10304


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*******@yaho o.de> schrieb im Newsbeitrag
news:41******** *************** @newsread4.arco r-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="dateforma t">
<xsl:param name="dateforma t">yyyy-MM-dd'T'HH:mm:ssZ</xsl:param>
<xsl:variable name="tz" select='java:ja va.util.SimpleT imeZone.new(0,
"GMT+00:00" )' />
<xsl:variable name="formatter "
select="java:ja va.text.SimpleD ateFormat.new($ dateformat)"/>
<xsl:variable name="settz" select="java:se tTimeZone($form atter, $tz)" />
<xsl:variable name="date" select="java:ja va.util.Date.ne w()"/>
<xsl:value-of select="java:fo rmat($formatter , $date)" />
</xsl:template>
--
Klaus Johannes Rusch
Kl********@atme dia.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
9286
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 three dropdow boxes for hours, minutes, and AM/PM. All of these need to be considered together and converted to one Unix Timestamp and then inserted to the MYSQL date field. The type of field is INT (11) so that I can instead of the standard...
3
38763
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 "the current date/time" above is replaced by the real current time (e.g. 12th Sep 2004 09:23:78 Michael
1
7550
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 milliseconds to be shown. BR Thomas
2
5179
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 (ApplicationID int ,timestamp datetime)
6
1772
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 ASP.NET and C# and need the expertese of individuals with more experience in these languages than I have. I may be completely off target as I thought this up very early in the morning. Here's the process as I see it: 1. InfoPath saves out the...
2
720
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 columns, and ultimately feed the result into a graph-drawing web thingy. I'm trying a few different ways to get what seems to be the same data, and seeing some odd behavior from the query planner. The table looks like this:
2
4346
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 showing what I am experiencing. The last own shows how converting timestamps to dates and then ordering doesn't give you the order you want. Maybe you should just order by the timestamp to begin with. However Date does not understand infinity at all.
22
6409
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 database. The original Update and Delete SP's all use a timestamp for concurreny checking. I am trying to use the same Update SP from my sqlDataSource but I keep getting the following error:
7
6109
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
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8810
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7410
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6211
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.