Installing and Registering the MSXML 5.0 SDK

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office

Installing and Registering the MSXML 5.0 SDK

Development Environment

The following system components are required for developing with Microsoft® XML Core Services (MSXML) 5.0 for Microsoft Office.

  • Windows-compatible computer
  • A supported 32-bit version of a Microsoft Windows® operating system product, such as Microsoft Windows® XP, Microsoft Windows® 2000, Microsoft Windows NT® 4.0, Microsoft Windows® Millennium Edition, or Microsoft Windows 98
  • Microsoft Internet Explorer 5.0 or later, if your solutions create output for display on the web browser
  • Microsoft Windows Script Host, if you want to view output without the web browser
  • Microsoft® Visual Studio®, if you create solutions with Visual Basic® or C++

Installing and Registering MSXML 5.0

The Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office Software Development Kit is installed on your computer in side-by-side mode. This mode protects the quality of applications that currently use the msxml.dll, msxml2.dll, msxml3.dll, or msxml4.dll files. This feature is important because different versions of the Microsoft Windows® operating system and Microsoft Internet Explorer are released with different versions of MSXML.

Side-by-side mode also allows you to decide which version of the parser to use in your code. When you install the MSXML 5.0 SDK from the Microsoft XML Download Center, the setup program installs two files onto your computer: msxml5.dll and either msxml5a.dll (if the computers runs under Windows 9x/ME) or msxml5r.dll (if the computers runs under Windows NT/2000/XP). The setup program registers the msxml5.dll file in the computer's registry.

After you install the MSXML 5.0 SDK, calling applications must use version-dependent CLSIDs and ProgIDs to reference and use msxml5.dll. This ensures stability in your applications. For example, you might have legacy coding that uses version-independent CLSIDs and ProgIDs such as the following JScript code:

var xml = new ActiveXObject("Msxml2.DOMDocument");
var xsl = new ActiveXObject("Msxml2.DOMDocument");

Even if MSXML 5.0 is deployed to client computers, the previous code would continue to run, and to call an earlier version of MSXML, such as version 2.0, 2.6, or 3.0. The exact version depends on other details, such as whether applications have been installed that are dependent on a specific version of MSXML, and that reconfigure the system to use that version by default. For more information and a list of CLSIDs and ProgIDs, see GUID and ProgID Information.

Earlier Versions of MSXML and the Xmlinst.exe Utility

Note   The MSXML 5.0 SDK does not provide an xmlinst.exe utility.

Earlier versions of MSXML, notably MSXML 2.5 and 3.0, can be installed in replace mode with the help of the xmlinst.exe utility. In this mode, the newly installed version of MSXML replaces an older version and becomes the default XML parser. When you call an application using version-independent CLSIDs or ProgIDs, the default XML parser is invoked. This causes compatibility problems in older applications.

For this reason, MSXML 5.0 can only be installed side-by-side. The xmlinst.exe utility does not work for it. To access MSXML 5.0 from an application, you must use the version-dependent CLSID or ProgID to instantiate the parser explicitly.

Using Version-Dependent ProgIDs

The following Microsoft JScript® code shows how to create an instance of the DOMDocument object using the version-dependent ProgID, Msxml2.DOMDocument.5.0.

var xml = new ActiveXObject("Msxml2.DOMDocument.5.0");
var xsl = new ActiveXObject("Msxml2.DOMDocument.5.0");

This ProgID is for MSXML 5.0. For a full example of how to call and use MSXML 5.0 to load and transform XML documents from script contained in a Web page, see Implementing MSXML 5.0 in Web Scripting.

In a similar way, to code to MSXML 2.6, use the following JScript syntax:

var xml = new ActiveXObject("Msxml2.DOMDocument.2.6");
var xsl = new ActiveXObject("Msxml2.DOMDocument.2.6");

For more information about ProgIDs, see GUID and ProgID Information. For more information about creating the DOMDocument object, see Using DOMDocument.

Important   Ensure the stability of your applications by updating older version-independent CLSIDs and ProgIDs to MSXML 5.0 version-dependent CLSIDs and ProgIDs. Otherwise, mixing the version-dependent and version-independent CLSIDs or ProgIDs in your code can cause problems with your application.

Limitation of Side-by-Side Mode

Currently, with MSXML 5.0 installed in side-by-side mode, Microsoft® Internet Explorer does not provide full MSXML 5.0 support for data islands. When you create a data island on a Web page and reference it as an object, the browser creates that object based on the version of MSXML used by the browser. For Internet Explorer 5.0 or later, this can be MSXML 2.0 or MSXML 2.5, both of which support Extensible Stylesheet Language (XSL), but not XSLT.

See Also

Dependencies in MSXML 5.0

Other Resources Other Resources

XML Development Center