Re: [xsl] javascript result in xsl variable

Subject: Re: [xsl] javascript result in xsl variable
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Thu, 19 Jul 2007 07:59:06 +0100
Vaduvoiu Tiberiu wrote:
> long story short. I need a variable that has the value of the url, I need to have a variable with the value of the url so I know where the user is...which in javascipt would be equal to document.location.href.
> 
> I tried using somehing like
> <xsl:variable name="url">
> <script>
> document.write(document.location.href);
> </script>
> </xsl:variable>
> 
> but it doesn't work. at this point I don't know if what i'm trying is possible but i'm hoping it can be done. 
> 10x in advance
> 

Sorry to bear bad news, but this won't work.
The XSL processor will keep the script element and text in the variable
verbatim. The script will only be executed when you view the page in
your web browser (assuming that's your method of delivery), by which
time the page has long left the xsl processor.
If you need the URL in the XSL, pass it in as a parameter.

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@xxxxxxxxxxx
www.groupbc.com

Current Thread