## Microsoft XML Data Source Object Applet

The XML Data Source ActiveX Object can be inserted into an HTML page as follows:

    <OBJECT width=0 height=0
        classid="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39"
        id="xmldso">
    </OBJECT>

This can be used as an XML data provider in conjunction with the data binding features of Internet Explorer 4.0. for binding XML data to HTML element on the page.

To load XML into the DSO use the XMLDocument property to get a DOM object model then call the load method, as follows:

    <SCRIPT for=window event=onload>
        var doc = xmldso.XMLDocument;
        doc.load("books.xml");
        if (doc.documentNode == null)
        {
            HandleError(doc);
        }
    </SCRIPT>

#### Inline XML

You can also provide the XML inline inside the OBJECT tag in which cas you can load the DSO as follows:

    <SCRIPT for=window event=onload>
        var doc = xmldso.XMLDocument;
        doc.loadXML(xmldso.altHtml);
        if (doc.documentNode == null)
        {
            HandleError(doc);
        }
    </SCRIPT>

#### Examples

The following example pages show how the applet works:

- Example 1: A simple HTML table populated by an external XML file
- Example 2: The same table populated by inline XML data
- Example 3: Nested HTML tables populated by hierarchical XML data
- Example 4: Editing the XML using bound INPUT fields
- Example 5: Report writer style of binding
- Example 6: Accessing the XML object model through JavaScript
- Example 7: Viewing XML data one record at a time using the recordset object model
- Example 8: Linking multiple XML DSOs together to view different parts of the XML document.
- Example 9: Hooking editable fields up to a live updating table
- Example 10: Same as Example 7, but editable

© 1997 Microsoft Corporation. All rights reserved. Terms of use.