I use the following line to pass a parameter to the XSL document
However, I am not sure about how to do this in IE, heere is my complete code:
Code:
xsltProcessor.setParameter(null, parameterName, parameterValue);
However, I am not sure about how to do this in IE, heere is my complete code:
Code:
if (window.ActiveXObject) {
//Transform the XML document
document.getElementById(outputTag).innerHTML = xmlDoc.transformNode(xslDoc);
} else {
// If using mozilla we have to use the XSLTProcessor
var xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xslDoc);
if (parametersToPass) {
var i = 0;
while (i < parametersToPass.length) {
var parameterName = parametersToPass[i];
i++;
var parameterValue = parametersToPass[i];
i++;
xsltProcessor.setParameter(null, parameterName, parameterValue);
}
}
var fragment = xsltProcessor.transformToFragment(xmlDoc, document);
// Output the XSL
document.getElementById(outputTag).innerHTML = "";
document.getElementById(outputTag).appendChild(fragment);
}