I am wanting to replace the two values 560, 420 with two xml variables in the following code
<a href="#" onmouseover="zoom(560,420,'logo','in')" onmouseout="clearzoom()">Zoom Out</a>
I have tried the following without success:
<a href="#" onmouseover="zoom("<xsl:value-of select='imagesize/@width'/>","<xsl:value-of select='imagesize/@height'/>",'logo','in')" onmouseout="clearzoom()">Zoom In</a>
Zoom is a Javascript function in the xsl code - function zoom(originalW, originalH, what, state)
How do I substitute the two xml variables <xsl:value-of select='imagesize/@width'/> and <xsl:value-of select='imagesize/@height'/>

you can't nest elements inside other element's attributes. what you'll need to do is either store the data in a variable and then use shorthand variable syntax in the attribute, or use the <xsl:attribute> tag.

Method #1 (by storing variables)

<xsl:variable name="winWidth"><xsl:value-of select='imagesize/@width'/></xsl:variable>
<xsl:variable name="winHeight"><xsl:value-of select='imagesize/@height'/></xsl:variable>

<a href="#" onmouseover="zoom('{$winWidth}','{$winHeight}','logo','in')" onmouseout="clearzoom()">Zoom In</a>

Method #2 (by <xsl:attribute>

<a href="#" onmouseout="clearzoom()">
<xsl:attribute name="onmouseover">
zoom('<xsl:value-of select='imagesize/@width'/>','<xsl:value-of select='imagesize/@height'/>','logo','in')
</xsl:attribute>
Zoom In
</a>

You shouldn't use double quotes inside doublequoted attributes =P

This article has been dead for over six months. Start a new discussion instead.