title: Why doesn't my JavaScript XML processing code work in Safari?
body: <p>I use the following code to open an XML document. It works in Firefox and IE, but fails in Safari. Any idea why?</p>
  
  <pre><code>function crearObjetoXML(archivoXML){
    //--- IE.
    if(window.ActiveXObject){
      xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async="false";
      xmlDoc.load(archivoXML);
      parsearXML();
    //--- FF.
    }else if(document.implementation &amp;&amp; document.implementation.createDocument){
      xmlDoc = document.implementation.createDocument("","",null);
      xmlDoc.load(archivoXML);
      xmlDoc.onload = parsearXML;
    }else{
      alert ('Su navegador no puede soportar este script');
    }
  }
  
  
  function parsearXML(){
    numrows = xmlDoc.getElementsByTagName('advertise')[0].childNodes.length;
    lnks1 = new Array(numrows);
    for (var i=0;i&lt;=numrows-1;i++)
    {
      lnks1[i] =  xmlDoc.getElementsByTagName('advertise')[0].getElementsByTagName('item')[i].getAttribute('link'); 
    }
  
  }
  crearObjetoXML('../imagerotatorxml.php');
  </code></pre>