Installing and Redistributing MSXML
The information in this topic is intended to familiarize you with MSXML installation, redistribution, versioning and common issues that you might encounter when using MSXML.
This topic focuses on the more recent MSXML versions. The following MSXML versions are covered:
MSXML version 6.0, see Installing and Redistributing MSXML 6.0.
MSXML version 4.0, see Installing and Redistributing MSXML 4.0.
MSXML version 3.0, see Installing and Redistributing MSXML 3.0.
MSXML 5.0 for Microsoft Office Applications is only available with Microsoft Office 2003 and is not covered in this topic.
MSXML side-by-side installation allows multiple versions to be loaded in memory and used simultaneously by separate applications that depend on different versions of MSXML. For example, MSXML 6.0 will install side by side with MSXML 3.0 and will not impact existing applications that use MSXML 3.0. When a service pack is installed for a version of MSXML, the service pack will completely replace the previous installation of that version. For example, a new service pack for MSXML 3.0 completely replaces the previous installation of MSXML 3.0, but does not affect an installation of MSXML 6.0. The only MSXML version where it is an option to have a later SP version installed without replacing the previous one is MSXML 4.0. This can be done by installing MSXML 4.0 in Windows OS Side-by-Side (WinSxS) mode.
It is not recommended to use Windows OS Side-by-Side (WinSxS) installations. Instead, you should validate your application with the latest service pack of the version of MSXML that you use.
It is recommended that you upgrade from earlier versions of MSXML to MSXML 6.0. MSXML 6.0 provides security and performance improvements over earlier MSXML versions.
To download the latest version of MSXML, see the XML Downloads page of the MSDN Online Library.
In order to build an application written in C++, a MSXML header file has to be included, and the project has to link to a MSXML library. The MSXML header file and library are installed when installing the MSXML SDK. To download MSXML SDK, go to the XML Downloads page of MSDN Online Library and choose the appropriate MSXML version.
If you install MSXML 6.0 SDK, by default your directory will be C:\Program Files\MSXML 6.0, with subdirectories named inc and lib.
When you write applications that use MSXML, you might also need to redistribute MSXML along with your application.
For MSXML 6.0, you should incorporate msxml6.msi into your application setup.
For versions prior to MSXML 6.0, use the Windows Installer merge module (Msxml.msm).
For MSXML 4.0, use the .CAB file (Msxml4.cab) method of distribution for Web download installations.
For more information about how to redistribute MSXML with your application setup, see the XML Downloads page of MSDN Online Library.
MSXML 3.0 was the last version of MSXML to support version-independent CLSIDs and ProgIDs. If you install later versions of MSXML, applications that use version-independent CLSIDs and ProgIDs will continue to run using the most recent version of MSXML that supports version independence, typically MSXML 3.0. To address a particular version of the parser, code should include version-dependent CLSIDs and ProgIDs.
The following statement invokes the version-independent DOM Document implemented in MSXML 3.0:
var dom = new ActiveXObject("msxml2.DOMDocument");
The following statement invokes a particular version of the parser, in this case MSXML 3.0:
var dom = new ActiveXObject("Msxml2.DOMDocument.3.0");
To use MSXML 6.0 instead of MSXML 3.0, use the following new MSXML 6.0 CLSID:
var dom = new ActiveXObject("Msxml2.DOMDocument.6.0");
Ensure the stability of your applications by updating older version-independent CLSIDs and ProgIDs to version-dependent CLSIDs and ProgIDs.