CreateObject(“MSXML2.DOMDocument”)

1. CreateObject(“MSXML2.DOMDocument”)
this is VB code to create a DOMDocument object using the MSXML2 library

2. new ActiveXObject(“MSXML.DOMDocument”)
this is javascript to create a DOMDocument object using the MSXML library

3. Server.CreateOject(“Microsoft.XMLDOM”)
this is ASP vbscript to create a version independent DOMDocument object

Note:
1. Only for built in objects, such as filesystemobject, dictionary etc. Any object which comes from an external library needs Server.CreateObject
2. CreateObject is a VBScript mechanism (not ASP). In NT4 it will create an object without the context of the caller. This has perfomance benefits, but this context contains things like the ASP intrinisc objects (Application, Session and so on). So if you want to use these objects in the called component, CreateObject will fail.
3. Server.CreateObject is an ASP construct and as such available in any language. It does create objects within the caller’s (ASP) context.
4. In Win2000 CreateObject has the same functionality as Server.CreateObject, there is effectively no difference.

Link: http://p2p.wrox.com/archive/asp_xml/2001-05/47.asp

One thought on “CreateObject(“MSXML2.DOMDocument”)

发表评论

电子邮件地址不会被公开。

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>