Use the C++ XML Data Source Object


This topic discusses the C++ XML Data Source Object (DSO). DSO was implemented for MSXML 3.0. Later versions of MSXML do not support it.

What Is the C++ XML Data Source Object?

Windows® Internet Explorer supports C++ Data Source Object (DSO) that can be used to bind XML to HTML, as well as Java XML DSO . The new C++ DSO gives you better performance and the ability to bind directly to an XML data island.

The C++ DSO allows you to create XML-driven Web applications in a completely declarative fashion, although it is still possible to write scripts against the XML document object. With the C++ DSO, both the Microsoft ActiveX® Data Objects (ADO) and XML object models are available to you.

How Do I Bind XML to HTML?

Consider the following XML file.

    <location>Santa Barbara, CA</location>
    <name>University of Texas at Arlington</name>
    <location>Arlington, TX</location>
    <location>Hattiesburg, MS</location>
    <location>Waco, TX</location>

You can bind this XML to a repeating table with the following HTML.

<XML ID=xmlDoc src="universities.xml"></XML>  
    <TD><SPAN DATAFLD="name"></SPAN></TD>  
    <TD><SPAN DATAFLD="location"></SPAN></TD>   

There is no need for an <APPLET> or <OBJECT> tag; the XML DSO does all the work for you.