title: Stymied by recent changes in browser javascript DOMParser and XSL
body: <p>The following used to work on Firefox 3.5.x and 3.6.x but it no longer does in Firefox 11.x or Safari 5.1.x. Javascript isn't my specialty, so I'm not up to speed on recent changes.</p>
  
  <p>Specifically, the Browse button apparently still 'successfully' loads a file (which should be an XML sequence export from FCP although this is not validated), but upon pressing the Process button the results of the XSLT no longer appear in the 'output' DIV as they used to with previous browser versions.</p>
  
  <p>It can be seen in context at <a href="http://johnpilgrim.net/color/jProcess.html" rel="nofollow">http://johnpilgrim.net/color/jProcess.html</a></p>
  
  <p>An appropriate sample XML file for testing is available at  <a href="http://johnpilgrim.net/color/sample.xml" rel="nofollow">http://johnpilgrim.net/color/sample.xml</a></p>
  
  <p>Nothing changed in the html, javascript or xsl so it seems to be a change in the recent browsers. I only designed and tested it to work in Firefox, and so never tested it in anything else.</p>
  
  <p>Thoughts? Solutions?</p>
  
  <p>Thanks!
  John</p>
  
  <pre><code>&lt;head&gt;
  
      &lt;script type="text/javascript"&gt;
  
          function jProcess(){
              // Get the file contents locally, using the nifty Firefox 3 nsIDOMFile interface
              var file_contents = document.getElementById('xml_file').files.item(0).getAsText("utf8");
  
              // Cast/Convert to an XML Document
              var parser = new DOMParser();
              xmlDoc = parser.parseFromString(file_contents, "text/xml");
  
              // XSLT Transformation
              var xslt = document.implementation.createDocument("", "", null);
              xslt.async = false;
              xslt.load("jProcess.xsl");
              var process = new XSLTProcessor();
              process.importStylesheet(xslt);
              var result = process.transformToFragment(xmlDoc, document);
  
              // Show the output
              document.getElementById('output').innerHTML= " ";               
              document.getElementById('output').appendChild(result);
  
              return false;
          };
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form method="post" onsubmit="return jProcess();"&gt;
  &lt;fieldset&gt;
      &lt;legend&gt;Select the XML file for the FCP sequence you want to process into HTML.&lt;/legend&gt;
      &lt;input type="file" size=100 name="xml_file" id="xml_file"&gt;
      &lt;input type="submit" value="Convert"&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;div id="output"&gt;&lt;/div&gt;
  </code></pre>
  
  <p></p>