title: XML cross-browser support
body: <p>I need help getting the file to run in Firefox: I have tried adapting scripts so that my file runs in both IE and Firefox but so far it still only works in IE. (The file can be tested at <a href="http://www.eyle.org/crosstest.html" rel="nofollow noreferrer">http://www.eyle.org/crosstest.html</a> - simply type the word Mike in the text box using IE (doesn't work in Firefox).The HTML document is:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC 
       "-//W3C//DTD XHTML 1.0 Transitional//EN" 
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Untitled Document&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          var xmlDoc;
          //loads xml using either IE or firefox
          function loadXmlDoc()
          {
              //test for IE
              if(window.ActiveXObject)
              {
                  xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
                  xmlDoc.async = false;
                  xmlDoc.load("books2.xml");
              }
  
              //test for Firefox
              else if(document.implementation &amp;&amp; document.implementation.createDocument)
              {
                  xmlDoc = document.implementation.createDocument("","",null);
                  xmlDoc.load("books2.xml");
              }
              //if neither
              else
              {
                  document.write("xml file did not load");
              }
          }
  
          //window.onload = loadXmlDoc();
          var subject;
          //getDetails adds value of txtField to var subject in outputgroup(subject)
          function getDetails()
          {
              //either this or window.onload = loadXmlDoc is needed
              loadXmlDoc();
              var subject = document.getElementById("txtField1").value;
              function outputgroup(subject) 
              {
                  var xslt = new ActiveXObject("Msxml2.XSLTemplate");
                  var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
                  var xslProc;
                  xslDoc.async = false;
                  xslDoc.resolveExternals = false;
                  xslDoc.load("contains3books.xsl");
                  xslt.stylesheet = xslDoc;
                  xslProc = xslt.createProcessor();
                  xslProc.input = xmlDoc;
                  xslProc.addParameter("subj", subject);
                  xslProc.transform();
                  document.write(xslProc.output);
              }
              outputgroup(subject);
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;input type="text" id="txtField1"&gt;
      &lt;input type="submit" onClick="getDetails(); return false"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The file includes books2.xml and contains3books.xsl (I have put the code for these files at ...ww.eyle.org/books2.xml   ...ww.eyle.org/contains3books.xsl) (NB: replace ...ww. with http:  //  www)</p>