[Sarissa-users] Internet Explorer Javascript Issue with Sarissa
Brought to you by:
mbatsis
From: Lyndsey P. <lyn...@cu...> - 2008-10-23 17:00:56
|
Hi, I have searched this list to see if anyone had a similar problem, and I am not an expert with xml, xslt or sarissa so please forgive my ignorance on certain matters regarding these subjects. I am using a mixture of xml/xslt/sarissa and javascript to transform xml docs into their respective xslt html output. You can see the basics of the application here (note that the task I am debugging is converting pounds to US dollars, I don't expect anything else to work. Also, I only set up the URL this evening so it may not be available just yet): http://dev.cubeclients.com/Local-Affiliate-Toolkit/CurrencyConvertor/currenc yconvertor.htm If you view this in firefox no problems at all so far. You should get a message like so: Result :2368.951USD 1 GBP = 1.937USD You have gained $62.495 If you'd bought this at Thomas Cook, you would have received $2255.090! View it in IE6 and the application seems to lose it's variable values. View it in IE 7 and I get a javascript error. I downloaded vwd to use it in conjunction with IE 7 as a javascript debugger (idea from this blog http://www.berniecode.com/blog/2007/03/08/how-to-debug-javascript-with-visua l-web-developer-express/) And the javascript errors seem to get triggered around line 245 of the sarissa.js file - vwd says: "Msxml6.dll:required attribute '{http://www.w3.org/1999/XSL/Transform} version' is missing." Line 245 in the sarissa,js is: "this.template.stylesheet = converted;" And the code block is : XSLTProcessor.prototype.importStylesheet = function(xslDoc){ if(!_SARISSA_THREADEDDOM_PROGID){ _SARISSA_THREADEDDOM_PROGID = Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0", "MSXML2.FreeThreadedDOMDocument.3.0"]); } xslDoc.setProperty("SelectionLanguage", "XPath"); xslDoc.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); // convert stylesheet to free threaded var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); // make included/imported stylesheets work if exist and xsl was originally loaded from url try{ converted.resolveExternals = true; converted.setProperty("AllowDocumentFunction", true); } catch(e){ // Ignore. "AllowDocumentFunction" is only supported in MSXML 3.0 SP4 and later. } if(xslDoc.url && xslDoc.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']") != null){ converted.async = false; converted.load(xslDoc.url); } else { converted.loadXML(xslDoc.xml); } converted.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); var output = converted.selectSingleNode("//xsl:output"); //this.outputMethod = output ? output.getAttribute("method") : "html"; if(output) { this.outputMethod = output.getAttribute("method"); } else { delete this.outputMethod; } this.template.stylesheet = converted; this.processor = this.template.createProcessor(); // for getParameter and clearParameters this.paramsSet = []; }; Looking at Mike Kay's response here: http://www.oxygenxml.com/archives/xsl-list/200003/msg00795.html This appears to be because of a missing 'version' attribute. However in my 'calc.xsl' file where I transform the xml, there is a version attribute so I am confused. I have checked the validation of the calc.xsl file in an xml editor called 'Xray' and in Firefox and all seems ok. I am wondering if there is a problem with the version attribute being omitted here: xslDoc.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); Or if this is symptomatic of something else - some oversight I have made. All help is greatly appreciated as I am going bonkers with this now! Any ideas? Thanks in advance! |