xsl-list
[Top] [All Lists]

Re: [xsl] javascript result in xsl variable

2007-07-19 00:00:24
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(_dot_)klyne(_at_)groupbc(_dot_)com
www.groupbc.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>