For a case like your example, you need to remember that until the
tranformation is finished, the javascript won't actually be running, so the
javascript variable won't have any value.
The XSL generates a node-tree, which is (usually) serialized out to text and
sent off to have something else use it, so none of the javascript will be
interpreted as anything except the contents of a node-tree until it gets to
that something else.
- Theo
-----Original Message-----
From: Ken Schulte [mailto:kschulte@xxxxxxxxxx]
Sent: Thursday, April 25, 2002 4:56 PM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: javascript variable in xsl:variable
Does anybody know if it is possible to add a javascript variable
into an xsl:variable?
example:
<xsl:template match="/">
<script language="javascript">
function test(strID)
{
<xsl:variable name="varID">
strID
</xsl:variable>
alert('<xsl:value-of select="$varID"/>
}
</script>
</xsl:template>
Thank you much,
Ken
________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|