I have a drop-down list now and I got it so when something is selected
from the drop down list it calls a JavaScript function. I want it so
the value selected from the drop-down list is sent as a parameter to
the xslt file. When I select a value from the drop-down list nothing
appears. I want just a basic listing of Title, Image, and Description
outputed. I have done a basic JavaScript that uses the .write()
function and that worked so the value is getting sent to the
JavaScript function from the drop-down list. So the problem has to be
with the .addParameter function. What could I be missing?
Here is my javascript and drop-down menu.
<body MS_POSITIONING= "FlowLayout ">
<form id="Form1" method="post" runat="server">
<SELECT name="select1" onchange='CallX ML(this.form.se lect1);'>
<OPTION value="Ratchet and Clank">Ratchet and Clank</OPTION>
<OPTION value="Sly Cooper">Sly Cooper</OPTION>
</SELECT>
</form>
</body>
<script language="javas cript">
function CallXML(dropdow n)
{
var myindex = dropdown.select edIndex;
var SelValue = dropdown.option s[myindex].value;
xml = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
xml.async = false;
xml.load("Games .xml");
xslt = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
xslt.async = false;
xslt.load("Game s.xslt");
xslTemp = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
xslTemp.stylesh eet = xslt;
var xslProc = xslTemp.createP rocessor();
xslProc.input = xml;
xslProc.addPara meter(Title, SelValue);
xslProc.transfo rm;
xslProc.output;
}
</script>
Here is my xslt file.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:lc="http://mark/DevelopmentWebs ite">
<xsl:output method="html"/>
<xsl:param name="Title"/>
<xsl:template match="/">
<h2>My Game Collection</h2>
<table border="1">
<xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
$Title]">
<tr>
<th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
</tr>
<tr>
<td>
<xsl:element name="IMG">
<xsl:attribut e name="SRC">
<xsl:value-of select="lc:Imag e"/>
</xsl:attribute>
</xsl:element>
</td>
<td><xsl:valu e-of select="lc:Desc ription"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>