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

Re[2]: How can I use a variable out of it scope ?

Subject: Re[2]: How can I use a variable out of it scope ?
From: viewga <viewga@xxxxxxxxxxxx>
Date: Wed, 31 Jan 2001 17:34:30 +0200
img src scoped
Hello frank,

Wednesday, January 31, 2001, 4:26:27 PM, you wrote:

fS> O.K. it works fine ! But how can I call upperLevelVar on a JavaScript
fS> function argument ?

fS> The following code ...

fS> <IMG SRC="images/open.gif">
fS>   <xsl:attribute name="onDblClick">
fS>    SetNode('<xsl:value-of select="$upperLevelVar"/>');
fS>    </xsl:attribute>
fS> </IMG>
xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:call-template name="test">
<xsl:with-param name="var">Some</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="test">
<xsl:param name="var" />
<IMG SRC="images/open.gif">
  <xsl:attribute name="onDblClick">
   SetNode('<xsl:value-of select="$var"/>');
   </xsl:attribute>
</IMG>
</xsl:template>
</xsl:stylesheet>
xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test1.xsl"?>
<root>root</root>

result:
<?xml version="1.0" encoding="UTF-8"?>
<IMG SRC="images/open.gif" onDblClick="&#10;   SetNode('Some');&#10;   "/>

fS> .. creates this html ouput :

fS> <IMG SRC="mygif.gif" onDblClick=""></IMG>
Test whether or not $upperLevelVar contains anything except of ''
with xsl:value-of outside of html.

fS> _________________________________________________________________________
fS> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


fS>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




-- 
Best regards,
 viewga                            mailto:viewga@xxxxxxxxxxxx




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.