MSXML Introduction and Resources
Microsoft XML Core services (MSXML) is a set of Microsoft tools and services for the creation of XML-based applications using Microsoft development tools.
MSXML is actually a set of World Wide Web Consortium (W3C) compliant application programming interfaces (APIs), widely used by countless software developers.
Over the years, MSXML has gone through numerous updates and releases, usually being released alongside other Microsoft products like Internet Explorer or Microsoft Office.
- MSXML 1.0 was released in 1997 and shipped with Internet Explorer 4.0.
- MSXML 2.0a was released in 1999 and shipped with Internet Explorer 5.0.
- MSXML 2.5 was released in 2000 and shipped with Windows 2000, Internet Explorer 5.01, and MDAC 2.5.
- MSXML 2.6 was released in 2000 and shipped with Microsoft SQL Server 2000 and MDAC 2.6.
- MSXML 3.0 was released in 2001 and shipped with Windows XP, Internet Explorer 6.0, and MDAC 2.7.
- MSXML 4.0 was released in 2001 as an independent software development kit (SDK).
- MSXML 5.0 was released in 2003 and shipped with Microsoft Office 2003 and Office 2007.
- MSXML 6.0 was released in 2005 and shipped with Microsoft SQL Server 2005, Visual Studio 2005, .NET Framework 3.0, Windows Vista, Windows 7, and Windows XP Service Pack 3.
MSXML versions 1.0, 2.0a, 2.5, 2.6, and 4.0 are obsolete and deprecated, while versions 3.0, 5.0 and 6.0 continue to be supported by Microsoft.
MSXML is the native Windows API for XML-based applications, conforming to the XML 1.0 standard.
Some of the services provided by MSXML include the Document Object Model (DOM) — a library for accessing XML documents; the Simple API for XML (SAX) — a programmatic alternative to DOM processing; XMLHttpRequest and Server XMLHTTPRequest for implementing AJAX and RESTful applications; use of XPath 1.0 queries over DOM documents; XML transformations using XSLT 1.0; and support for the XSD 1.0 specification with the XmlSchemaCache.
All new applications should be written to comply with MSXML 6.0, the latest version of MSXML, or XmlLite, a lightweight XML parser for native code projects.
MSXML services are programmatically exposed as Object Linking and Embedding (OLE) automation components, and can be used by developers using C, C++ native programming languages, or Jscript and VBScript active scripting languages.
Use of MSXML Component Object Model (COM) components is not recommended or supported if you are writing managed code targeting .NET Framework in C#, Visual Basic, managed C++ or any other managed programming language. MSXML uses specific threading modes and garbage collection routines that are not compatible with the .NET Framework. XML functionality should be implemented in .NET applications using classes from the System.Xml namespace or the LINQ to XML, both native to the .NET framework. Using MSXML in .NET applications through COM interoperability can result in unexpected problems that are difficult to debug.
MSXML is often used in processing XML in web applications, or as a standalone process using the Document Object Model (DOM). DOM and Simple API to XML (SAX2) can be utilized in any programming language that is capable of using ActiveX or COM objects.
Should I Use and Learn MSXML?
If your programming work revolves around applications using the .NET Framework, you do not need to worry about MSXML, since using it in .NET projects is not recommended.
On the other hand, if you work on native code or scripting programming language projects that interact with XML, you will probably be using MSXML or its lightweight alternative, XmlLite.
Many open-source alternatives to MSXML exist, for example NativeXML, but you must choose an alternative that will support your programming language.
If you work on programs that interact with XML, and those programs do not rely on the .NET Framework, you should take a look at the following resources on MSXML:
- The Microsoft Developer Network MSXML Documentation section provides a full overview and documentation for MSXML.
- The Microsoft Developer Network Learn MSXML section provides useful resources like a beginner's guide, tutorials, and a user forum covering the use of MSXML. You can also download MSXML6 from this page.
Books that cover MSXML specifically are quite rare, in part due to the fact that there are ample MSXML resources available online. Also, many books about scripting language programming have chapters on MSXML. In some cases, these chapters are quite comprehensive and in-depth, while others merely offer a basic overview of MSXML.
- XML Application Development with Msxml 4.0 (2002) by Ayers, et al: this book covers MSXML 4.0, now considered obsolete. Despite that, readers may find many examples useful.
While MSXML has not been deprecated, and is still in widespread use, its long-term relevance is up for debate. Development has slowed down to a crawl and MSXML's time has obviously come and gone.
However, MSXML is still used in many projects, although the range of its potential applications is dwindling. For starters, it should not be used with .NET Framework. It's not the only way of ensuring XML interaction, either. Various open-source alternatives are available, but dealing with each one of them was beyond the scope of this article.
In case you still want to master MSXML, or merely brush up your old skills, you might have a hard time finding fresh resources. A lot of MSXML resources, especially books and other print resources, are woefully outdated and cover deprecated versions of MSXML. This does not render them useless, but it does limit their usefulness and forces you to double-check much of what you read, just to make sure it applies to MSXML 6.0.
MSXML 6.0 was released more than a decade ago, and while Microsoft still supports it (technically), it's obvious that the end of the road for MSXML is near.
Further Reading and Resources
We have more guides, tutorials, and infographics related to coding and development:
- Microsoft Visual Basic / Visual Studio: this is our basic primer on Visual Studio with a focus on Visual Basic.
- XML Resources and Validators: learn all about XML itself.
- C# Resources: as one of the most popular languages in the .NET firmament, C# is very helpful to know.
What Code Should You Learn?
Confused about what programming language you should learn to code in? Check out our infographic, What Code Should You Learn? It not only discusses different aspects of the languages, it answers important questions such as, "How much money will I make programming Java for a living?"