I have the following that outputs an xml file to a div using ajax:
<script type="text/javascript">
function ajaxXML(url,con trol_id){
if (document.getEl ementById) {
var x = (window.ActiveX Object) ? new
ActiveXObject(" Microsoft.XMLHT TP") : new XMLHttpRequest( );
}
if (x) {
x.onreadystatec hange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getEle mentById(contro l_id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
</script>
<body onload="ajaxXML ('XMLSample.xml ','xmlOutPut')" >
<div id="xmlOutPut" >
</div>
</body>
My question is the xml file has a stylesheet reference in it:
<?xml-stylesheet type="text/xsl" href="XMLSample .xslt"?>
when I open the xml file in a browser, it applies the styesheet, but
when I process it using ajax in the above example, the stylesheet/xslt
is ignored. I am new to ajax and I am probably missing something
simple. Any help is appreciated.