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

Subject: RE: [xsl] Getting date of the XSL transformation into HTML output
From: "LAJ" <shaard@xxxxxxxxxxxxxx>
Date: Fri, 20 Jul 2001 13:34:28 +0100
Ahhh I see your problem...I cant see anyway of passing a parameter using
those tools however I'm a newbie so what do I know? ;)

I should probably leave this reply to Rene but what the hell. Taking Rene's
example create an html file containing the following



		<script type="text/javascript">
			// Load your XSL
			var objXSLT = new ActiveXObject("MSXML2.FreeThreadedDomDocument")
			objXSLT.async = false

			// create a compiled XSL-object
			var objCompiled = new ActiveXObject("MSXML2.XSLTemplate")
			objCompiled.stylesheet = objXSLT.documentElement

			// create XSL-processor
			var objXSLProc = objCompiled.createProcessor()

			// Load your XML
			var objXML = new ActiveXObject("MSXML2.FreeThreadedDomDocument")
			objXML.async = false

			// input for XSL-processor
			objXSLProc.input = objXML
			objXSLProc.addParameter("date", Date())
			// etc.

			// transform

			// display



Substitute the stylesheet and XML filenames as appropriate. Modify your
stylesheet and add in

<xsl:param name="date"/>

you can then access the date parameter you have passed by using
<xsl:value-of select="$date"/>

To view this of course you then have to load up the html file that you
created rather than executing the transformation through xmlspy.

Hope that helps rather than hinders (i.e. I hope I'm right and not leading
you up the garden path heheh )


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Ghostrider
Sent: 20 July 2001 11:54
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: 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