S
Stephen
I have the following that outputs an xml file to a div using ajax:
<script type="text/javascript">
function ajaxXML(url,control_id){
if (document.getElementById) {
var x = (window.ActiveXObject) ? new
ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getElementById(control_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.
<script type="text/javascript">
function ajaxXML(url,control_id){
if (document.getElementById) {
var x = (window.ActiveXObject) ? new
ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getElementById(control_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.