Processing XML with MSXML

MSXML supports two basic APIs for processing XML: DOM and SAX (the Simple API for XML). Let's start with DOM.

MSXML and DOM

As I've mentioned, the DOM method involves parsing an XML document and loading it into a tree structure in memory. An XML document parsed via DOM is known as a DOM document (or just DOM, for short). Listing 8.9 presents a simple VB application that demonstrates parsing an XML document via DOM and querying it for a particular node set. (You can find the source code for this app in the CH08\domltest subfolder on the CD accompanying this book.)

Listing 8.9. A VB App That Processes an XML Document via DOM
 Private Sub Command1_Click() Dim bstrDoc As String bstrDoc = "<Songs> " & _ "<Song title='One ...

Get Guru's Guide to SQL Server Architecture and Internals, The 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.