Opened 13 years ago

Closed 12 years ago

#2392 closed defect (wontfix)

Using XMLDOM CLSID in CreateDocument causes errors with XSLT parameters

Reported by: igornaumov at hotmail dot com Owned by: alex
Priority: high Milestone: 1.0
Component: HTML Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

For some reason CreateDocument? in dojo.dom is using "MSXML2.XMLDOM" ActiveX instead of "MSXML2.DOMDocument". If an element from a document created that way is used as a parameter in an XSLT transformation, in IE6 it results in a TypeMismatch? error. Here is a sample code:

dojo.require("dojo.io.*");
dojo.require("dojo.dom.*");
dojo.require("dojo.xml.*");
dojo.require("dojo.xml.XslTransform");

function testDom() {
   var xmlSource = dojo.dom.createDocumentFromText(
	"<?xml version='1.0' encoding='utf-8'?>" + 
	"<root>It works!</root>" );
   var xslProc = new dojo.xml.XslTransform("test.xsl");
   var params = new Array( new Array("test", xmlSource.documentElement));

   result = xslProc.getResultString(xmlSource, params, window.document );
   alert(result);
}
	
dojo.addOnLoad(testDom);

test.xsl:

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:param name='test'/>
<xsl:template match='/'>
	<xsl:copy-of select='$test'/>
</xsl:template>
</xsl:stylesheet>

In Mozilla everything works, in IE6 it gives an error "Type mismatch" on addParameter. If the CLSID list in dom.js is changed to match one used in xml/XslTransform.js, everything works.

Change History (3)

comment:1 Changed 12 years ago by bill

Component: DOMHTML
Milestone: 1.0
Owner: changed from anonymous to sjmiles

Not sure I even understand this bug but it seems to be about xml support, which is just in dojox? Scott, please correct me if I'm wrong.

comment:2 Changed 12 years ago by sjmiles

Owner: changed from sjmiles to alex

I don't know anything about this. Alex is actually the module owner for dojo.html.

comment:3 Changed 12 years ago by Tom Trenka

Resolution: wontfix
Status: newclosed

This looks more like a bug with legacy 0.4 code; we didn't port a lot of dojo.dom, and aren't going to in the near future.

If and when we start bringing in cross-browser XML tools in DojoX, we'll keep this in mind (I'm not sure why that CLSID was used either, I'd prefer DomDocument?.4.0 if possible.)

Note: See TracTickets for help on using tickets.