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

Re: Pass a variable value from javascript to xsl

Subject: Re: Pass a variable value from javascript to xsl
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 07 Apr 2005 13:45:55 +0100
javascript variable value
>>>>> "ohtar" == ohtar  <enrech@xxxxxxxxx> writes:

    ohtar> I am trying to pass a variable value from javascript to
    ohtar> xsl. For example, I have a xsl:variable called instance:
 
 
    ohtar>  <xsl:variable name="instance"/>
 
 
    ohtar>   And I want to assign a javascript variable value to
    ohtar> 'instance' The javascript code is:
  
 
    ohtar>  <script language="JavaScript"> function example(){ var art
    ohtar> art =
    ohtar> document.exampleForm.artistOnChange[document.noadsterForm.artistOnChange.selectedIndex].text
    ohtar> } </script>
 
    ohtar> I call the javascript function in my xsl code when someone
    ohtar> select something in a form:

You are NOT calling the javascript function from your xslt code - you
are using XSLT to GENERATE a call to a javascript function (presumably
you are generating html). This is a very different thing indeed.
  
    ohtar>  <select name="artistOnChange" onchange="example">
 
 
    ohtar>   I want to save the value of the javascript variable 'art'
    ohtar> into the xsl:variable 'instance'. How can I do that?  I'm
    ohtar> using xalan.
  
You can't. XSLT finishes, and you are left with an html page, which
you are then displaying (presumably) in your web browser.
-- 
Colin Paul Adams
Preston Lancashire

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.