[Webkit-unassigned] [Bug 20444] New: Could not post dom to xsl by setParameter in Safari

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 18 20:31:11 PDT 2008


           Summary: Could not post dom to xsl by setParameter in Safari
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ydshang at gmail.com

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't happen in IE and FF. So I think maybe this is a
bug. Please see the following code:
    <title>Enter the title of your HTML document here</title> 
    <script type="text/javascript"> 
      var xmlDoc; 
      var xsltDoc; 
      var xmlFile="Test_xsltProcessor.xml"; 
      var xsltFile="Test_xsltProcessor.xsl"; 

      function show_xml() 
        // Firefox, Opera 8.0+, Safari 
        if(document.implementation && 
           //load xml file 
           XMLDocument.prototype.load = function(filePath) 
              var xmlhttp = new XMLHttpRequest(); 
              xmlhttp.open("GET", filePath, false); 
              var newDOM = xmlhttp.responseXML; 
              if( newDOM ) 
               var newElt = this.importNode(newDOM.documentElement, 
               return true; 
         xmlDoc = document.implementation.createDocument("", "", 
         xmlDoc.async = false; 

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

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

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

        var doc =  xslt.transformToFragment(xmlDoc, document); 
        //append the xml result to the main html file 
        var target=document.getElementById("divContent"); 
        while (target.hasChildNodes()) 
      else if(typeof window.ActiveXObject != 'undefined') 
         //load xml file 
         xmlDoc = new ActiveXObject( "MSXML2.FreeThreadedDomDocument. 
3.0" ); 
        xmlDoc.async = false; 

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

        var template = new ActiveXObject( "MSXML2.XSLTemplate. 
3.0" ); 
        template.stylesheet = xsltDoc; 
        var processor = template.createProcessor(); 
        processor.input = xmlDoc; 

        //append the xml result to the main html file 
        var target=document.getElementById("divContent"); 
        target.innerHTML = processor.output;; 
<body onload="show_xml();"> 
    <p>Enter the body text of your HTML document here</p> 
    <div id="divContent"></div> 

The xsl file is as following: 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ 
  <xsl:param name="testDom"/> 
  <xsl:template match="/"> 
      <xsl:value-of select="$testDom"/> 

The xml file is as following: 
<?xml version="1.0" encoding="UTF-8"?> 

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!

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list