RE: [xsl] Getting date of the XSL transformation into HTML output

Subject: RE: [xsl] Getting date of the XSL transformation into HTML output
From: Rene de Vries <RdVries@xxxxxxxxxxx>
Date: Fri, 20 Jul 2001 14:35:05 +0200
Hi Armin,

This is not an XSL-question, but I know how difficult it is to find an 
answer to these XSL-related questions, so I will answer it on the forum.

Just create in XMLSpy a new HTML-page (delete the code Spy puts in) and 
copy my example in it:
Change "YourStylesheet.xsl" into the name of your stylesheet.
Change "YourXML.xml" into the name of your xml-file.
Replace the 2 addParameter-lines with the one you want:
objXSLProc.addParameter("CurrentDate", Date())
This HTML-file has only one function: take your XML, transform it with your 
XSL into HTML and display it.

In your stylesheet you can access the parameter like this:

<xsl:stylesheet version="1.0" 
	<xsl:param name="CurrentDate"/>

	<xsl:template match="match something">
		<!-- do something -->
		parameter $CurrentDate : <xsl:value-of select="$CurrentDate"/>
		<!-- do something else -->


If you now select in Spy the browser view (click the icon "Page with Globe" 
or choose View, Browser view), your generated HTML should be displayed. You 
could also doubleclick on the HTML-file you created with Spy in the Windows 

You should see something like this:
parameter $CurrentDate : Fri Jul 20 14:10:23 2001

This is realy not an XSL-question and thus should be handled outside this 
forum, so if you still need help on this, please mail me directly (maybe 
even in Dutch, my French is below zero ;-)))

Greetings Rene
   { @   @ }

"You don't need eyes to see, you need vision!"

-----Oorspronkelijk bericht-----
Van:	Ghostrider [SMTP:ghostrider@xxxxxxxxxxx]
Verzonden:	vrijdag 20 juli 2001 12:47
Aan:	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Onderwerp:	RE: [xsl] Getting date of the XSL transformation into HTML 

Hi Rene (and Lee)

[it seems my previous reply didn't make the list for some reason so I'm
posting this again]

Rene wrote:

>I don't quite understand your problem.
>The date your XSL is generating the HTML is the current date isn't it?


>So why not use one of the suggestions how to get the current date and use 
><xsl:value-of select="the current-date-function of your choice"/> to 
it into your HTML?

And what would that current-date-function look like? I really have no idea 
to syntax, use,...)!

>And if you're using msxml3 (or just IE) and want to know how to pass a
>parameter: see my earlier mail:

I'm using XMLSpy and MSXML3.
I had a look at your example code but i don't know

1. where to put in my XSL
2. how to adapt it to so I get the current date in the output HTML

As to your reply, Lee:

Same problem: how do I use a param to actually get that date?
I'd appreciate any help on this (though i didn't think it would be this
complicated to get it done).

Thanks everyone,


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread