Jump to content

Transforming XSLT to XHTML


Sarek

Recommended Posts

Posted

There's a great exampling of transforming XSLT to XHTML on this W3Schools site, but the example does not work in IE 10. It works great in previous versions of IE, Firefox and Chrome though. Could anyone offer a a fix that would allow it to work in IE 10 as well? http://www.w3schools...ename=cdcatalog Thanks

Posted

You would need to change the Javascript code loading the files, if you want to use XSLT on responseXML with transformNode then with IE 10 you need to make sure you use the MSXML object, so change

function loadXMLDoc(dname){if (window.XMLHttpRequest)  {  xhttp=new XMLHttpRequest();  }else  {  xhttp=new ActiveXObject("Microsoft.XMLHTTP");  }xhttp.open("GET",dname,false);xhttp.send("");return xhttp.responseXML;}

to

function loadXMLDoc(dname){  var req;  if (typeof ActiveXObject !== 'undefined') {    req = new ActiveXObject('Msxml2.XMLHTTP.3.0');  }  else if (typeof XMLHttpRequest != 'undefined')  {    req = new XMLHttpRequest();  }  if (req) {    req.open('GET', dname, false);    req.send();    return req.responseXML;  }  // else handle case here that browser does not support ActiveXObject nor XMLHttpRequest}

Posted

Thanks for the code. I wish I was at home now and could try it out with IE 10. I'm at work and we're still on IE 8. This will be something to look forward to tonight. Thanks again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...