|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Javascript variable to XSL variable
Camalesn wrote:
On Thu, 17 Feb 2005 08:53:19 -0800, Robert Koberg wrote: it seems like it is :)
Why are you using a select attribute? Why not just: <xsl:template match="files">
<select name="combo1" onchange="transformSelection(this.value)">
<xsl:apply-templates mode="create-options"/>
</select>
</xsl:template><!-- I would use the same elem name for 'files' children, but -->
<xsl:template match="*" mode="create-options">
<option value="normalize-space(.)">
<xsl:value-of select="."/>
</option>
</xsl:template>This will create the dropdown. Then, when running in the browser, the user selects an option and triggers the onChange event. You send the current value of the select to a javascript function that loads the file and uses it as the XML source in a client-side transform. Use another XSL that works with this source. Place the result of the transform in some HTML div or what-have-you -- or rewrite the whole page if you need to.
Well, you can't communicate the onchange event to the transformation. You have to use javascript to communicate and setup another transformation. Hopefully what I wrote above makes sense. best, -Rob
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








