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

Re: Putting Mouseover Javascript Script in XSLT?

Subject: Re: Putting Mouseover Javascript Script in XSLT?
From: Steve <subsume@xxxxxxxxx>
Date: Tue, 4 Sep 2007 00:15:45 -0400
Re: Putting Mouseover Javascript Script in XSLT?
I have a lot of experience with this sort of thing and it sounds like
a Javascript problem. There are times when XSL will render Javascript
funny, but 99% of the time my Javascript is used much like yours and
I've never had a problem.

You could try using alert('message') to make certain that the
Javascript is triggering as expected, and probably lots of other
things, but unfortunately all that is out of the scope of this list.
=) Keep at it, sounds like you're almost there.

-Steve

On 9/4/07, Alice Ju-Hsuan Wei <ajwei@xxxxxxxxxxx> wrote:
> Hi, Guys:
>
> Thanks for helping out with the tip, and now it does print out the
> proper node as it should be. It also shows the original preset image.
>
>   However, when I scroll over the mouse, its arrows point up but does
> not display the image. This is my modified code:
>
> <xsl:template match="graphic">
>
>         <a>
>             <xsl:attribute name="href">#</xsl:attribute>
>             <xsl:attribute
> name="onmouseout">MM_swapImgRestore()</xsl:attribute>
>             <xsl:attribute
> name="onmouseover">MM_swapImage('Image1','','<xsl:value-of
>                     select="./@url"/>',1)"</xsl:attribute>
>             <img>
>                 <xsl:attribute name="src">BG008.jpg</xsl:attribute>
>                 <xsl:attribute name="alt">
>                     <xsl:value-of select="./@alt"/>
>                 </xsl:attribute>
>                 <xsl:attribute name="id">
>                     <xsl:value-of select="./@id"/>
>                 </xsl:attribute>
>                 <xsl:attribute name="width">150</xsl:attribute>
>                 <xsl:attribute name="height">113</xsl:attribute>
>                 <xsl:attribute name="border">0</xsl:attribute>
>                 <xsl:attribute name="name">Image 1</xsl:attribute>
>             </img>
>         </a>
>
>         <xsl:call-template name="id"/>
>         <xsl:call-template name="rend"/>
>         <xsl:attribute name="alt">
>             <xsl:choose>
>                 <xsl:when test="../figDesc">
>                     <xsl:value-of select="../figDesc/text()"/>
>                 </xsl:when>
>
>                 <xsl:otherwise>
>                     <xsl:value-of select="'graphic'"/>
>                 </xsl:otherwise>
>             </xsl:choose>
>         </xsl:attribute>
>
>     </xsl:template>
>
> Does anyone know if template values do conflict with the javascript in XML?
>
> Thanks to those who can help.
>
> A Newbie.
>
> Quoting Steve <subsume@xxxxxxxxx>:
>
> > Hey there,
> >
> > Your xsl and javascript look more or less accurate, so in the event
> > its not working I'd try some things:
> >
> > 1) Put xsl:attributes directly after the <img> tag, assuming that is
> > the tag you're adding attributes to.
> >
> > 2) Perform some simple debug measures by echo'ing the actual value of
> > /@url to make sure it is as expected.
> >
> > 3) Make sure the Javascript actually works. If you're using Firefox,
> > check the 'error console' to make extra certain your problem isn't
> > Javascript.
> >
> > -Steve

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.