I have a script that loads and parses an XML document. Firefox and IE handle it fine (although requiring an ActiveX object in IE), but Opera can't seem to. The problem appears to be in the "xmlDoc.load" function. It gives an error message of:

"Type mismatch (usually a non-object value used where an object is required)"

But I can't see why this would show up... any ideas?
Here is the pertinent code:

Code:
function importXML(url){
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = function(){
			cleanWhitespace(xmlDoc.firstChild);
			xmlDoc = xmlDoc.firstChild.firstChild;
			initKanjiList();
			document.documentElement.addEventListener("scroll", initScroll, false);
			document.getElementById("character").innerHTML = "<span class='normalText'>Click on a character.</span>";
		}		
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = false; 
 	}
	else
	{
		alert('Your browser can\'t handle this script');
		return;
	} 
	xmlDoc.load(url);
	if(window.ActiveXObject){ 	
		xmlDoc = xmlDoc.childNodes[1].firstChild;
		initKanjiList();
		window.attachEvent("onscroll", initScroll, false);
		document.getElementById("character").innerHTML = "<span class='normalText'>Click on a character.</span>";
	}
}