Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl]Putting Mouseover Javascript Script in XSLT?

From: Steve <subsume@--------->
To:
Date: 9/4/2007 4:16:00 AM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent