Ticket #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: | 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
Note: See
TracTickets for help on using
tickets.