RE: [xsl] embedding xsl within javascript

Subject: RE: [xsl] embedding xsl within javascript
From: "Rob Bradley" <rob@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Jul 2004 16:13:52 -0700
sorry guys, ignore my last posting - it does work

(except for the {$ImgDir} which still doesn't parse)

yes option 3 is defo the best option, not completely sure
how to do it yet but I know what your saying

cheers geezas!

-----Original Message-----
From: dave frette [mailto:gohabitat@xxxxxxxxx]
Sent: Thursday, July 29, 2004 8:05 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] embedding xsl within javascript

Hi Rob - My second post!  =)

1. You could attempt to create a wrapper onmouseover/onmouseout function.
Do not use CData around it.


function mm_swapimage_wrapper(paramImgSrc) {
  myImg.src = <xsl:value-of select="$ImgDir" /> +  paramImgSrc;
  MM_swapimage('a1', '', myImage.src);

working example:

2. Modify you current <a> tag

<a href="about.asp?page=1">
  <xsl:attribute name="onmouseover">
    MM_swapImage('a1', '', '/
    <xsl:value-of select="$ImgDir"/>/about/about1_on.gif',1)

3.  Same as #2, only cleaner.  Create an XSLT file that updates your XML, to
the whole onmouseover parameter for each image.  Or you could just rewirte
your XML file or your XML generation process.  Then, your <a> is even

<a href="about.asp?page=1">
  <xsl:attribute name="onmouseover">
    <xsl:value-of select="mouse_over_event"/>

working example of my own here:
(not all links work because it's still under construction so to speak.)

I hope this helps,

- Dave

--- Rob Bradley <rob@xxxxxxxxxxxxxxxxxxxx> wrote:

> hi there, my first post here - how exciting...   ;)
> within my xsl I have the following basic rollover functionality
> ----
> <a href="about.asp?page=1"
> onmouseover="MM_swapImage('a1','','/images/about/about1_on.gif',1)"
> onmouseout="MM_swapImgRestore()"><img src="/images/about/about1.gif"
> border="0" name="a1"/></a>
> ----
> I want to add a parameter to the image path, which is straightforward
> if its just around the <img> tag:
> ----
> <xsl:attribute name="src"><xsl:value-of
> select="$ImgDir"/>about/about1_on.gif</xsl:attribute></img>
> ----
> but what within javascript statements? like in the mouseover state
> above? how do I add the $ImgDir into the image path?
> many thanks
> rob

Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Current Thread