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: http://www.biglist.com/lists/xsl-list/archives/200107/msg00002.html 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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="CurrentDate"/> <xsl:template match="match something"> <!-- do something --> parameter $CurrentDate : <xsl:value-of select="$CurrentDate"/> <!-- do something else --> </xsl:template> </xsl:stylesheet> 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 Explorer. 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 output 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? Yes >So why not use one of the suggestions how to get the current date and use the ><xsl:value-of select="the current-date-function of your choice"/> to hardcode it into your HTML? And what would that current-date-function look like? I really have no idea (as 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: http://www.biglist.com/lists/xsl-list/archives/200107/msg00002.html 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, Armin XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Getting date of the XSL t, LAJ | Thread | RE: [xsl] Getting date of the XSL t, LAJ |
RE: [xsl] Getting date of the XSL t, LAJ | Date | [xsl] whitespace, Carlos Durand Silves |
Month |