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

Passing javascript value into xsl

Subject: Passing javascript value into xsl
From: Mick <mick@xxxxxxxxxxxx>
Date: Mon, 5 Feb 2001 20:33:56 +0100
javascript value
Hi all,

I have the following problem: I would like to pass a value obtained from a
pull down list (value obtained through xsl from an xml file) to a function
that will filter the same xml file for additional data. The xsl for the pull
down list is:

<form name="tales">
<select id="tales" onChange="displayList(this.form)">
<option value="">select a tale</option>
	<xsl:for-each select="mabinogion/tale/talename">
		<option value="{.}">
			<xsl:value-of select="."/>
		</option>
	</xsl:for-each>
</select>
</form>

The value of the pull down menu is stored as javascript "var x =
tales.tales.value". I want to use this value as a filter for another bit of
xsl:

<xsl:for-each select="mabinogion/tale[talename=' ->x goes here<- ']">
	<xsl:for-each select="manuscript">
		<xsl:value-of select="manuscriptname"/>
		<br/>
	</xsl:for-each>
</xsl:for-each>

and use the result of this xsl to populate <div id="list"></div> through:

<script language="JavaScript">
function
{
list.innerHTML = ->result of the previous xsl<-
}
</script>

All above bits work well seperately, but I can't get the whole thing to work
together (the quotes are probably the problem, but I've tried every possible
combination). Has anyone got any hints/clues/ideas/valium?

-mick



 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.