January 25, 2002 - The Threading Models
January 25, 2002 The Threading Models Tips: January 2002
Yehuda Shiran, Ph.D.
|
DOMDocument
represents the top node in the tree. It implements all the base DOM document methods and provides additional members that support XSL and XML transformation. Only one object can be created: the document
. All other objects are accessed or created starting from the document
. The document
object can be created using either a free-threaded or a rental-threaded model. The free-threaded model is designed for multiple thread access. The rental-threaded model is designed for a singlel-thread model. The rental-thread model is faster because the parser does not need to manage concurrent access among threads. If you are going to run on a single-process machine, be sure to choose the rental-threaded model. Here are two ways to create the two types of objects:
var objDoc = new ActiveXObject("Msxml2.DOMDocument");
var objFTDoc = new ActiveXObject("Msxml2.FreeThreadedDocument");