Althought I dont have exactly the same need as you, this works for me both in IE 6.0.28 and NS 7.1
html files and
JS function
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
<script>
<!--
function importXml(strFileName)
{
//pour Netscape Mozilla et similaire
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload=function(){getTextFromXml();}
}
//pour IE
else if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.onreadystatechange=function(){if(xmlDoc.rea dyState == 4){getTextFromXml();}}
}
//ceux qui ne supportent pas
else
{
alert('Your browser can\'t handle this script');
return;
}
xmlDoc.load(strFileName);
}
function getNodeValue(strNodeName)
{
var xNode = xmlDoc.getElementsByTagName(strNodeName);
if(xNode.length > 1)
{
alert('There is more than one node !');
return false;
}
else if (xNode.length == 0)
{
return false;
}
else
{
if(xNode[0].text)
return xNode[0].text;
else if(xNode[0].firstChild)
return xNode[0].firstChild.data
else
return false;
}
}
function getTextFromXml()
{
var strTexte, elements, i;
//construction d'un tableau d'élément en fonction des capacités des différents browsers
elements = typeof document.all!='undefined' ? document.all : document.getElementsByTagName('*');
for(i=0; i < elements.length; i++)
{
//alert(elements[i].tagName.toLowerCase());
switch(elements[i].tagName.toLowerCase())
{
case "p" :
strTexte = getNodeValue(elements[i].id);
if(strTexte != false)
{
elements[i].innerHTML = strTexte;
}
break;
case "input" :
strTexte = getNodeValue(elements[i].id);
if(strTexte != false)
{
elements[i].value = strTexte;
}
break;
case "img" :
strTexte = getNodeValue(elements[i].id);
if(strTexte != false)
{
elements[i].alt = strTexte;
elements[i].title = strTexte;
}
break;
}
}
}
//-->
</script>
</head>
<body onload="javascript
:importXml('test.xml');">
<input type="button" value="" name="input_clic" id="input_clic" />
<img id="img_test" name="img_test" src="apache_pb.gif" alt="" title="" />
<p id="txt_accueil" name="txt_accueil"></p>
</body>
</html>
The content of test.xml
<?xml version="1.0" encoding="windows-1250"?>
<root>
<input_clic>cliquez ici</input_clic>
<txt_accueil>Le contenu du paragraphe.</txt_accueil>
<img_test>texte de l'image</img_test>
</root>
Hope this help.
---------
Goulh