Ticket #2392 (closed defect: wontfix)

Opened 22 months ago

Last modified 14 months ago

Using XMLDOM CLSID in CreateDocument causes errors with XSLT parameters

Reported by: igornaumov at hotmail dot com Owned by: alex
Priority: normal Milestone: 1.0
Component: HTML Version: 0.4.1
Severity: normal Keywords:
Cc:

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

Changed 18 months ago by bill

  • owner changed from anonymous to sjmiles
  • component changed from DOM to HTML
  • milestone set to 1.0

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.

Changed 18 months 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.

Changed 14 months ago by ttrenka

  • status changed from new to closed
  • resolution set to wontfix

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.