// JavaScript Document
var xmlDoc;
function loadXML(xXML,xXSL)
{
// code for IE
if (window.ActiveXObject)
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async=false;
  xmlDoc.load(xXML);
  xmlXsl=new ActiveXObject("Microsoft.XMLDOM");
  xmlXsl.async=false;
  xmlXsl.load(xXSL);
document.write(xmlDoc.transformNode(xmlXsl));
  }
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation &&
document.implementation.createDocument)
  {
 var xslStylesheet;
	var xsltProcessor = new XSLTProcessor();
    var myDOM;
    var xmlDoc;
      // load the xslt file
      var myXMLHTTPRequest = new XMLHttpRequest();
      myXMLHTTPRequest.open("GET", xXSL, false);
      myXMLHTTPRequest.send(null);
   
      xslStylesheet = myXMLHTTPRequest.responseXML;
      xsltProcessor.importStylesheet(xslStylesheet);

      // load the xml file
      myXMLHTTPRequest = new XMLHttpRequest();
      myXMLHTTPRequest.open("GET",xXML, false);
      myXMLHTTPRequest.send(null);
      
      xmlDoc = myXMLHTTPRequest.responseXML;      
      var fragment = xsltProcessor.transformToFragment(xmlDoc, document);       
      document.getElementById("example").innerHTML = "";
      myDOM = fragment;
      document.getElementById("example").appendChild(fragment);        

  }
else
  {
  alert('Your browser cannot handle this script');
  }
}
