function Test(){ var xmlDom = new ActiveXObject("Msxml2.DOMDocument"); xmlDom.async = false; xmlDom.loadXML(...); if(xmlDom.parseError.errorCode != 0){ var myErr = xmlDom.parseError; alert("XML 加载错误: " + myErr.reason); }else{ var xslt = new ActiveXObject("Msxml2.XSLTemplate"); var xsltDom = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); xsltDom.async = false; xsltDom.load("??.xslt"); if(xsltDom.parseError.errorCode != 0) { var myErr = xsltDom.parseError; alert("XSLT 加载错误: " + myErr.reason); }else{ xslt.stylesheet = xsltDom; var xslProc = xslt.createProcessor(); xslProc.input = xmlDom; xslProc.transform(); var openWin = window.open("about:blank","mans","toolbar=no,location=no,menubar=no,scrollbars=yes,left=100,top=100,width=250"); try{ openWin.document.writeln(xslProc.output); }catch(ex){ } } } }
Choosing a Threading Model
There are two versions of the XML control.
- rental model
- The rental model version is designed for single-threaded access. To use the rental model control, use the "Microsoft.DOMDocument" progID.
- free-threaded model
- The free-threaded version is designed for multiple thread access. To use the free-threaded control, use the "Microsoft.FreeThreadedDOMDocument" progID.
If you plan for several threads to access your XML data from a single control, be sure to use the free-threaded control. If only one thread will access the XML data, use the rental model control for better performance.
The following is a sample global.asa file that creates session-level and application-level free-threaded versions of the XML control.
<SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Session_OnStart ON error RESUME next SET Application("AppFXMLdoc") = _ server.CreateObject("MSXML2.FreeThreadedDOMDocument") SET Session("SessFXMLdoc") = _ server.CreateObject("MSXML2.FreeThreadedDOMDocument") End Sub Sub Session_OnEnd ON error RESUME next SET Session("SessFXMLdoc") = nothing SET Application("AppFXMLdoc") = nothing Session("SessFXMLdoc") = empty Application("AppFXMLdoc") = empty End Sub </SCRIPT>
Scripts accessing the Session and Application objects will be able to simultaneously access the "AppFXMLdoc" and "SessFXMLdoc" objects.
南来地,北往的,上班的,下岗的,走过路过不要错过!
======================个性签名=====================
之前认为Apple 的iOS 设计的要比 Android 稳定,我错了吗?
下载的许多客户端程序/游戏程序,经常会Crash,是程序写的不好(内存泄漏?刚启动也会吗?)还是iOS本身的不稳定!!!
如果在Android手机中可以简单联接到ddms,就可以查看系统log,很容易看到程序为什么出错,在iPhone中如何得知呢?试试Organizer吧,分析一下Device logs,也许有用.