JScript/VBScript error

I'm trying to have a script automatically transform an xml file into several html files using different xslt style sheets. However, whatever I try, I get errors. I've tried it in both VBscript and JScript, and both give me errors. The xml file is 537 KB, and the xsl file is 5 KB. Here's iteration 1 in JScript. This script works for one of my style sheets (a style sheet that creates a smaller html file), but on a stylesheet that creates a bigger html file, it gives me an "invalid procedure call or argument" on outstr (as if outstr didn't return properly) error : var xsl = new ActiveXObject("MSXML2.DomDocument.6.0"); xsl.async = false; var boolval = xsl.load("../Commands/commands.xsl"); if(!boolval) { WScript.Echo("XSL load error"); WScript.Quit(); } var xml = new ActiveXObject("MSXML2.DomDocument.6.0"); xml.async = false; boolval = xml.load("../Commands/commands.xml") if(!boolval) { WScript.Echo ("XML load error " ); WScript.Quit(); } var fso = new ActiveXObject("Scripting.FileSystemObject"); var outstr = xml.transformNode(xsl); var ofl = fso.CreateTextFile("../Commands/commands.html", true, false); ofl.Write (outstr); ofl.Close(); So here's iteration 2, using the transformNodeToObject method instead. In this case, I get an "Unspecified error" code 80004005 in msxml6.dll: var xsl = new ActiveXObject("MSXML2.DomDocument.6.0"); xsl.async = false; var boolval = xsl.load("../Commands/commands.xsl"); if(!boolval) { WScript.Echo("XSL load error"); WScript.Quit(); } var xml = new ActiveXObject("MSXML2.DomDocument.6.0"); xml.async = false; boolval = xml.load("../Commands/commands.xml") if(!boolval) { WScript.Echo ("XML load error " ); WScript.Quit(); } var result = new ActiveXObject("MSXML2.DomDocument.6.0"); xml.transformNodeToObject(xsl, result); result.save("../Commands/commands.html"); My intuition says that the processor just can't handle creating a file that big. Is this right, or am I doing something wrong. If it's just a size issue, is there some other library/object I can use in vbscript/jscript that will get the job done?

以上就是JScript/VBScript error的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏