•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 427,329 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,117 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums
Views: 3155 | Replies: 1
![]() |
•
•
Join Date: Jan 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
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'/>
<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'/>
•
•
Join Date: Jul 2006
Location: Deptford, London
Posts: 964
Reputation:
Rep Power: 5
Solved Threads: 48
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)
Method #2 (by <xsl:attribute>
You shouldn't use double quotes inside doublequoted attributes =P
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
If it only works in Internet Explorer; it doesn't work.
![]() |
•
•
•
•
•
•
•
•
DaniWeb RSS, Web Services and SOAP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
afghanistan api asp bbc bebo blogger blogging code development dom drama feed firefox gdata google hardware html javascript katemodern linspire linux logitech lonelygirl15 mice microsoft mouse news on openoffice peripherals politics programming reader rss soap standards terror terrorist tv video voters w3c war weather web wmd xml xoap youtube
- Mouse Cursor Image (Java)
- Hyperlink a div (JavaScript / DHTML / AJAX)
- Adding mouse listener to a frame (Java)
- Help modify some JavaScript/HTML (JavaScript / DHTML / AJAX)
- variables from javascript in asp.net (ASP.NET)
- New Ajax Tutorial (IT Technologies and Trends)
- transfer double array from asp to javascript (ASP.NET)
- Locking the mouse button down (C)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: Need an Editor
- Next Thread: SOAP n00b


Linear Mode