Click to See Complete Forum and Search --> : loading XML+XSL in IE


Aysha Akther
07-16-2008, 07:24 AM
Hello All!!
i am very new in xml.i write some code to load xml+xsl that is like:
function loadXMLDoc(fname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Msxml2.DOMDocument.5.0");
}
// 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()
{
///////////////LOAD XML & XSL/////////////////
xml=loadXMLDoc("2006WDRnew.xml");
xsl=loadXMLDoc("Book2006_ISBN.xsl");
// code for IE
if (window.ActiveXObject)
{
ex=xml.transformNode(xsl);
document.getElementById("example").innerHTML=ex;
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xsltProcessor=new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("example").appendChild(resultDocument);
}
it works fine for mozilla.but it does not work for IE if any entity present in xml file.i have checked it for both internal dtd and external dtd file.it doesn't work in IE.
can anyone help me how i can load xml's with entities in IE.

thanks in advance for any help.
//aysha