Subject: Re: [xsl] Javascript variable to XSL variable From: Robert Koberg <rob@xxxxxxxxxx> Date: Thu, 17 Feb 2005 10:16:25 -0800 |
On Thu, 17 Feb 2005 08:53:19 -0800, Robert Koberg wrote:
This isn't an XSL problem. You should get this working in plain HTML first. You probably want something like:
<select name="combo1" onchange="transformSelection(this.value)"> <option value="file1.xml">Option1</option>
Well, is not as easy as it seems. ;-)
I need the value of the combo box in order to use it as XSL variable:
<select name="combo1"> <option select="{$nodevalue}">Option1</option> <option select="{$nodevalue}">Option2</option> <option select="{$nodevalue}">Option3</option> <option select="{$nodevalue}">Option4</option> </select>
<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>
Where $nodevalue is the value of one XML node.
<files> <node1>file1.xml</node1> <node2>file2.xml</node2> <node3>file3.xml</node3> <node4>file3.xml</node4> </files>
After that, on every "onchange" event I need to display some information:
<xsl:value-of select="document('$nodevalue')/select/some/other/node/value"/>
best, -Rob
If user selects "Option 1" in combo box, I have to load file1.xml If the user selects "Option 2 " in combo box, I have to load file2.xml, and so on.
Thanks for your ideas, they are very welcome.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Javascript variable to XS, Camaleón | Thread | Re: [xsl] Javascript variable to XS, Camaleón |
Re: [xsl] Custom node-set in a vari, Lyublinski, Leonid | Date | Re: [xsl] keyed lookup table, David Carlisle |
Month |