Código:
// Código para cargar los archivos XML y XSL
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;
}
function displayResult(){
f = unescape(params["f"]);
xml=loadXMLDoc("perfil.xml");
xsl=loadXMLDoc("perfil.xsl");
// Código para IE
if (window.ActiveXObject){
ex=xml.transformNode(xml);
document.getElementById("info").innerHTML=ex;
}
// Código para Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument){
xsltProcessor=new XSLTProcessor();
xsltProcessor.setParameter(null, "id", unescape(params["id"]));
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("info").appendChild(resultDocument);
}


