MSXML Tutorial
(Page 1 of 5 )
This article, the first of three parts, explains what MSXML is and how to access an XML document using JavaScript. It is excerpted from chapter 10 of
XML DeMYSTified, written by Jim Keogh and Ken Davidson (McGraw-Hill/Osborne, 2005; ISBN: 0072262109).
You combine the power of XML and programming languages such as JavaScript, Visual Basic, and C++ when you use Microsoft’s XML Core Services, simply referred to as MSXML. MSXML is an application program interface that contains features that enable you to interact with XML from within an application written in one of the commonly used programming languages.
This means that you can unleash an XML document from within a program rather than having to use a web browser.You can easily integrate any XML document into your application by calling features of MSXML from within your program.
You’ll learn about MSXML in this chapter and how to access an XML document using JavaScript. The same basic principles used for JavaScript can be applied to other programming languages.
What Is MSXML? XML is a dynamic approach to managing information. As you’ve learned throughout this book, you can access an XML document using an XML-enabled browser. This is fine if you want to display all or a portion of an XML document. Simply follow the directions we present in this book and you’re able to view information contained in the XML document from your browser.
However, accessing an XML document using an application other than a browser can be tricky because code must be written within the application to extract information contained in the XML document.
Fortunately, Microsoft provides the magic wand to take the pain out of writing code to access an XML document from within an application with Microsoft XML Core Services—MSXML for short. MSXML consists of preprogrammed classes and functions that contain code to access and manipulate information in an XML document.
You don’t have to write the tedious code to read and parse an XML document because Microsoft has done this for you. All you need to do is to call the appropriate classes or functions within your application to work with an XML document.
MSXML is designed for a variety of programming languages, including C, C++, Visual Basic, VBScript, Jscript, and JavaScript. You can download the MSXML API at http://msdn.microsoft.com/xml/default.aspx, and will need to do so before you can use the examples we illustrate in this chapter.
We use JavaScript as the programming language for this chapter because you don’t need to use a compiler to create a JavaScript application. You simply write the code using the same editor that you use to write your web page. JavaScript is executed by calling the JavaScript from a web page using your browser.
We’ll show you a few JavaScript basics in this chapter—enough so you can get started using MSXML. However, you may want to read JavaScript Demystified by Jim Keogh (McGraw-Hill Osborne Media, 2005) to become proficient using JavaScript.
You’ll need to install the MSXML API or download it from the Microsoft web site. We’re using version 4.0; however, you should download the latest release.
Next: Getting Down and Dirty with MSXML >>
More XML Articles
More By McGraw-Hill/Osborne
|
This article is excerpted from chapter 10 of XML DeMYSTified, written by Jim Keogh and Ken Davidson (McGraw-Hill/Osborne, 2005; ISBN: 0072262109). Check it out today at your favorite bookstore. Buy this book now.
|
|