Setting Up MSXML3.0

Fortunately, when using Python for your XML development, you don’t have to give up MSXML3.0. The Microsoft parser is fully accessible from Python using Python’s COM support.

If you haven’t already, you’ll need to visit http://www.python.org/ and install win32all.exe as a supplement to your Python installation. This Windows-specific package provides support for Microsoft’s Component Object Model (COM) framework. The win32all.exe package must be installed prior to using COM objects. More details of working with Python and COM can be found in Chapter 9, in which COM is used to access the MSSOAP collection of objects.

Version 3.0 is the latest incarnation of Microsoft’s parser. It provides full support for XSLT, among other things. However, Version 3.0 might not be the version used in other applications, such as Internet Explorer. This may or may not be of concern to you. If you are somehow running Python inside an application, or using automation from Python to talk to another application, you need to be aware that a foreign application’s parser may be an older version. Knowing the particular version of the user’s copy of MSXML is primarily of concern for those writing client-side script inside Internet Explorer where the parser may be chosen for them (as in an XSLT stylesheet linked in an XML file). Standalone applications, on the other hand, can pick their own parser (as we do in this appendix).

If you are writing programs in Python, you typically use a program ...

Get Python & XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.