Hallo @all
my problem is XMLHTTP by Mozilla Browser
is an example W3SCHOOL
http://www.w3schools.com/xsl/xsl_client.asp
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>html work with xml and xsl</title>
<meta content="text/html; charset=us-ascii" http-equiv="Content-Type">
<script type="text/javascript">
var xsltProcessor;
var xml;
var xsl;
var xhttp;
var ex;
function checkBrowserName(name){
var agent = navigator.userAgent.toLowerCase();
if (agent.indexOf(name.toLowerCase())>-1) {
return true;
}
return false;
}
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
alert('mozilla ie7 ie8');
xhttp=new XMLHttpRequest();
}
else
{
alert(' <= ie6');
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}
function displayResult()
{
//xml=loadXMLDoc("http://localhost/catalog.xml");
//xsl=loadXMLDoc("http://localhost/catalog.xsl");
// code for IE
if (window.ActiveXObject)
{
xml=loadXMLDoc("http://localhost/catalog.xml");
xsl=loadXMLDoc("http://localhost/catalog.xsl");
alert("IE 1");
alert("IE 12" + xml);
alert("IE 13" + xsl);
ex=xml.transformNode(xsl);
alert("IE 2");
document.getElementById("example").innerHTML=ex;
alert("IE 3");
}
else if (document.implementation && document.implementation.createDocument)
{
alert("moz1");
xml=loadXMLDoc("http://localhost/catalog.xml");//failt
//xml=loadXMLDoc("file:///D:/forum/catalog.xml");//works
//xml=loadXMLDoc("catalog.xml");//works
alert("moz12" + xml );
xsl=loadXMLDoc("file:///D:/forum/catalog.xsl");//works
//xsl=loadXMLDoc("catalog.xsl");//works
alert("moz13"+ xsl);
xsltProcessor=new XSLTProcessor();
alert("moz2"+ xsl);
xsltProcessor.importStylesheet(xsl);
xsltProcessor.setParameter(null, "sort", "ascending");
xsltProcessor.setParameter(null, "datatyp", "text");
xsltProcessor.setParameter(null, "kn", "title");
alert("moz3");
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("example").appendChild(resultDocument);
}
}
</script>
</head>
<body onload="displayResult()">
<div><input type="button" value="sort" id="txtSearch" onclick="displayResult();"></div>
<div id="example" />
</body>
</html>
why failt mozilla by this "http://localhost/catalog.xml"