hello,

I'm trying to transform an XMLdocument using XSLT to output as HTML in a <div>. The code I have works great in IE but won't work in Firefox or anything else. I've run this script through the Js debugger in Firefox and it comes back with "strResult is 'undefined'". If I convert the xsl variables to local variables, it comes back with 'xsl is undefined' of course. Anyways the code is as follows:

Code:
<script>
//function triggered by onload event handler...
function loadXML(){
	var db = document.getElementById('dbName').value;	
	//if Firefox, Safari, Opera, etc.
	if(document.implementation && document.implementation.createDocument){
		xsl=document.implementation.createDocument("","",null);
	}
	//if Microsoft
	else if(window.ActiveXObject){
		xsl=new ActiveXObject("Microsoft.XMLDOM");
	}
	//make sure the xsl doc is fully loaded
	xsl.async=false;
	//load the xsl stylesheet
	xsl.load("/" + db + "/treeMenu.xsl?openpage");
	//load the function carrying the DXL URI
	var strXml=getHtmlFromXml("/" + db + "/NewCalculatedQList?ReadViewEntries&Count=-1&CollapseView");
	document.getElementById("idContent").innerHTML=strXml;
}

function getHtmlFromXml(xmlsrc){
	var xml=null;
	//if w3c spec 
	if(document.implementation && document.implementation.createDocument){
		var xml=document.implementation.createDocument("","", null);
	}
	//if Microsoft
	else if(window.ActiveXObject){
		var xml=new ActiveXObject("Microsoft.XMLDOM");
	}
	//makes sure the xml doc is fully loaded
	xml.async=false;
	xml.load(xmlsrc);
	if(typeof XSLTProcessor != "undefined"){
		Node.prototype.transformNode=function(xsl){
			var processor=new XSLTProcessor();
			processor.importStylesheet(xsl);
			//outputs object Document
			var resultDom=processor.transformToDocument(this);
			var strResult=resultDom.xml;
                        //the strResult comes up 'undefined' if xsl is global
			if (strResult.indexOf("<transformiix:result") > -1){
				strResult = strResult.substring(strResult.indexOf(">") + 1, strResult.lastIndexOf("<"));  
			}
 		}
 	}
	//xsl comes back undefined if the xsl variables are localized...
	var strValue=xml.transformNode(xsl);
	xml=null;
	//alert(strValue)
	return strValue;
}
</script>
Any help or advice would be appreciated. thanks in advance.