<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>20444</bug_id>
          
          <creation_ts>2008-08-18 20:31:11 -0700</creation_ts>
          <short_desc>Could not post dom to xsl by setParameter in Safari</short_desc>
          <delta_ts>2008-08-19 04:58:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>14101</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jason.Shang">ydshang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88793</commentid>
    <comment_count>0</comment_count>
    <who name="Jason.Shang">ydshang</who>
    <bug_when>2008-08-18 20:31:11 -0700</bug_when>
    <thetext>Hi all, 
I have a site that works perfectly in IE6 IE7 FF2 FF3 but not in the 
latest Safari. When I use setParameter to post dom to xsl. It will change to string while this issue doesn&apos;t happen in IE and FF. So I think maybe this is a bug. Please see the following code:
[Code] 
&lt;html&gt; 
&lt;head&gt; 
    &lt;title&gt;Enter the title of your HTML document here&lt;/title&gt; 
    &lt;script type=&quot;text/javascript&quot;&gt; 
      var xmlDoc; 
      var xsltDoc; 
      var xmlFile=&quot;Test_xsltProcessor.xml&quot;; 
      var xsltFile=&quot;Test_xsltProcessor.xsl&quot;; 

      function show_xml() 
      { 
        // Firefox, Opera 8.0+, Safari 
        if(document.implementation &amp;&amp; 
document.implementation.createDocument) 
        { 
           //load xml file 
           XMLDocument.prototype.load = function(filePath) 
           { 
              var xmlhttp = new XMLHttpRequest(); 
              xmlhttp.open(&quot;GET&quot;, filePath, false); 
              xmlhttp.setRequestHeader(&quot;Content-Type&quot;,&quot;text/xml&quot;); 
              xmlhttp.send(null); 
              var newDOM = xmlhttp.responseXML; 
              if( newDOM ) 
             { 
               var newElt = this.importNode(newDOM.documentElement, 
true); 
               this.appendChild(newElt); 
               return true; 
            } 
         } 
         xmlDoc = document.implementation.createDocument(&quot;&quot;, &quot;&quot;, 
null); 
         xmlDoc.async = false; 
         xmlDoc.load(xmlFile); 


         //load xsl file 
         var xsltDoc =  document.implementation.createDocument(&quot;&quot;, 
&quot;&quot;, null); 
         xsltDoc.async = false; 
         xsltDoc.load(xsltFile); 


         //build the relationship between xml file and xsl file 
         var xslt = new XSLTProcessor(); 
         xslt.importStylesheet(xsltDoc); 


         //set parameters 
        xslt.setParameter( null, &apos;testDom&apos;, xmlDoc); 


        //transform 
        var doc =  xslt.transformToFragment(xmlDoc, document); 
        //append the xml result to the main html file 
        var target=document.getElementById(&quot;divContent&quot;); 
        while (target.hasChildNodes()) 
        { 
            target.removeChild(target.lastChild); 
        } 
        target.appendChild(doc); 
      } 
      else if(typeof window.ActiveXObject != &apos;undefined&apos;) 
      { 
         //load xml file 
         xmlDoc = new ActiveXObject( &quot;MSXML2.FreeThreadedDomDocument. 
3.0&quot; ); 
        xmlDoc.async = false; 
        xmlDoc.load(xmlFile); 


        //load xsl file 
        xsltDoc = new ActiveXObject( &quot;MSXML2.FreeThreadedDomDocument. 
3.0&quot; ); 
        xsltDoc.async = false; 
        xsltDoc.load(xsltFile); 


        var template = new ActiveXObject( &quot;MSXML2.XSLTemplate. 
3.0&quot; ); 
        template.stylesheet = xsltDoc; 
        var processor = template.createProcessor(); 
        processor.input = xmlDoc; 
        processor.addParameter(&quot;testDom&quot;,xmlDoc); 
        processor.transform(); 


        //append the xml result to the main html file 
        var target=document.getElementById(&quot;divContent&quot;); 
        target.innerHTML = processor.output;; 
       } 
    } 
    &lt;/script&gt; 
&lt;/head&gt; 
&lt;body onload=&quot;show_xml();&quot;&gt; 
    &lt;p&gt;Enter the body text of your HTML document here&lt;/p&gt; 
    &lt;div id=&quot;divContent&quot;&gt;&lt;/div&gt; 
&lt;/body&gt; 
&lt;/html&gt; 


The xsl file is as following: 
&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/ 
Transform&quot;&gt; 
  &lt;xsl:param name=&quot;testDom&quot;/&gt; 
  &lt;xsl:template match=&quot;/&quot;&gt; 
    &lt;div&gt; 
      &lt;xsl:value-of select=&quot;$testDom&quot;/&gt; 
    &lt;/div&gt; 
  &lt;/xsl:template&gt; 
&lt;/xsl:stylesheet&gt; 


The xml file is as following: 
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; 
&lt;root&gt; 
  &lt;test&gt;aaa&lt;/test&gt; 
&lt;/root&gt; 


In Safari, the output is [object Document]   --It changes to 
string£¬but in IE and 
Firefox, the output is aaa. 

Any help will be much appreciated.Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88810</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-08-19 04:58:19 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 14101 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>