|
Subject: [xsl] Parameters to XSL from Javascript From: Robert G <nyjets3422@xxxxxxxxx> Date: Fri, 15 May 2009 10:36:17 -0700 (PDT) |
Hi,
I have been working on getting my XSL to be generated through javascript and I got it to work for firefox and IE. But the problem is I was able to pass a parameter for the firefox section but not the IE. I looked up how to do it for IE but it doesn't seem to work. Please let me know if you see any problems with it. Heres my code....
function loadXMLDoc(fname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(fname);
return(xmlDoc);
}
function displayResult()
{
xml=loadXMLDoc("test.xml");
xsl=loadXMLDoc("test.xsl");
// code for IE
if (window.ActiveXObject)
{
var xsltCompiled = new ActiveXObject("Microsoft.XMLDOM");
xsltCompiled.stylesheet = xsl.documentElement;
var xsltProc = xsltCompiled.createProcessor();
xsltProc.input = xml;
xsltProc.addParameter('item',itm);
xsltProc.transform();
}
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] FYI: firefox/XSL hack, Robert Koberg | Thread | Re: [xsl] Parameters to XSL from Ja, Martin Honnen |
| [xsl] FYI: firefox/XSL hack, Robert Koberg | Date | Re: [xsl] Parameters to XSL from Ja, Martin Honnen |
| Month |