[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: embedding xsl within javascript

Subject: Re: embedding xsl within javascript
From: dave frette <gohabitat@xxxxxxxxx>
Date: Thu, 29 Jul 2004 08:05:02 -0700 (PDT)
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.

example:

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

working example:
http://www.suodenjoki.dk/us/productions/articles/photo_gallery.htm

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)
    about/about1_on.gif')
  </xsl:attribute>
</a>




3.  Same as #2, only cleaner.  Create an XSLT file that updates your XML, to include 
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 easier!

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

working example of my own here:
http://www.frettefamily.com/xml/galleries.xml
(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.
http://promotions.yahoo.com/new_mail 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.