473,782 Members | 2,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert current timestamp/date from XSLT stylesheet into a XML document ???

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>..."t he 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

Jul 20 '05 #1
3 38790
Am Mon, 04 Oct 2004 07:41:38 +0200 schrieb Michael Hertz:
<currtime>..."t he current date/time"....</currtime>


With xsltproc I use:
--stringparam date="`date stylesheet.xsl` "

Then you have to a xsl:param where the value is the momentary date

Thomas
Jul 20 '05 #2
Its possible with extension functions..

Please try this..
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:datetime= "http://exslt.org/dates-and-times"
exclude-result-prefixes="datet ime">

<xsl:template match="/">
<currtime>
<xsl:value-of select="datetim e:dateTime()" />
</currtime>
</xsl:template>

</xsl:stylesheet>

(Tested with Xalan-J 2.6.0)

Regards,
Mukul

mh****@yahoo.co m (Michael Hertz) wrote in message news:<cj******* ******@news.t-online.com>...
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>..."t he 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

Jul 20 '05 #3


Michael Hertz wrote:
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>..."t he 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


With XSLT 1.0/XPath 1.0 you need to define a global parameter e.g.
<xsl:param name="now" />
and then use processor specific means to set that parameter before you
run the transformation.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #4

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

Similar topics

4
10314
by: Thomas Mann | last post by:
Hi, how can I make my XSLT-stylesheet insert a timestamp (date/time) into the output file ? Regards Thomas
7
5208
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element name from inbound xml to my internal elements to standardize disparate input. Now I could just create an xslt stylesheet for each possible inbound format and be done, but I think it would be powerful to be able store this mapping in a database and...
2
3519
by: Richard L Rosenheim | last post by:
I loaded a XSLT stylesheet into a XMLDocument to retrieve some of the data. I received an exception when the SelectNodes method was invoked. The message was "System.Xml.XPath.XPathException - Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function." Q324899 I queried MSDN for Namespace Manager and found this article: "Manage namespaces Using the XmlNamespace Manager"...
4
1680
by: dar_imiro | last post by:
Hi, I'm trying to get rid of frames as menu holder in my html-page. I'd also like to separate the menu structure to xml and xslt. Also the actual content is divided to xml and its corresponding stylesheet. The idea ofcourse is to import the separate menu.xml to the content.xslt file so the menu markup wont clutter every content.xml page.
16
5491
by: Brian Tkatch | last post by:
I have a PROCEDURE that test other PROCEDUREs. Timings_Call ------------------ Id Group Name Text Timings_Log
4
7722
by: th1421 | last post by:
Hi, I'm new to FireFox. I am currently trying to convert my website to be compatible with it. Doing so I’m trying to process some XML/XSLT pages (preferably without using JavaScript). When I view my XML pages using IE 6 or 7 it displays beautifully both accessed locally as through HTTP on my ISP’s server where I put them using FTP. When I view them in Mozilla FireFox 2.0, it displays ok when accessed locally. The CSS presentation –...
0
1669
by: gpspocket | last post by:
help me -CURSOR backward insert from End Date > to Start Date how to insert dates from end to start like this SELECT 111111,1,CONVERT(DATETIME, '17/03/2008', 103), CONVERT(DATETIME, '01/03/2008' i explain i have stord prosege that create mod cycle shift pattern and it working ok
7
9203
by: Damir | last post by:
I have a situation on a DB server where the "current timestamp" command shows the actual system time offset by one hour, which has never been noticed before?!? The DB2 is V9.1 (FP03), running on AIX 5.3. System timezone is offset by one hour to GMT, but this shouldn't cause such behavior. # echo $TZ NFT-1DFT,M3.5.0,M10.5.0
1
11894
by: somadritadas23 | last post by:
I have a variable declaration inside a procedure which is not compiling in db2 9.5 :- DECLARE VSTARTTIME TIMESTAMP DEFAULT CURRENT TIMESTAMP; The procedure is a test procedure :- DROP PROCEDURE ABC_1 @ CREATE PROCEDURE ABC_1 ( INOUT STARTTIME TIMESTAMP , INOUT ENDTIME TIMESTAMP ,
0
9639
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
9474
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
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10143
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...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8964
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
7486
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
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2870
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.