I have been looking for a solution and unable to find one.
I have an xml file and xsl file that is used to transform and display the xml file. I can sort and filter the xml document through the xsl file and it works fine.
<xsl:variable name="filval" select="'720p'" />
<xsl:for-each select="Movie_Prices/price[quality=$filval]">
I would like to have a html form with a select box and onchange event associated with it that when the user changes the value of the selectbox, the value is taken and replaces the select="'720p'" in the variable or directly into the Xpath to update the results.
<Movie_Prices>
<price id="1" status="use">
<quality>720p</quality>
<amount currency="LKR">20</amount>
</price>
<price id="2" status="void">
<quality>720p</quality>
<amount currency="LKR">30</amount>
</price>
<price id="3" status="use">
<quality>1080p</quality>
<amount currency="LKR">40</amount>
</price>
<price id="4" status="void">
<quality>1080p</quality>
<amount currency="LKR">50</amount>
</price>
<price id="5" status="use">
<quality>3D</quality>
<amount currency="LKR">80</amount>
</price> <price id="6" status="void">
<quality>3D</quality>
<amount currency="LKR">120</amount>
</price>
</Movie_Prices>
is this possible? any combination of xsl or javascript would be enough as long as the result works fine. Have searched alot and did not come up with a solution.
Any help appreciated and thanks in advance
<xsl:param name="filval">to pass the values. I'm not sure if there is a way to do that in the browser, and if there is you would have to recompile your XSLT since variable and parameter binding is part of the static context. It would probably be more efficient to alter your XML via the JavaScript DOM API.