Next

XML Data Source Applet

Example 1

This example shows how to use the XML DSO to bind XML data to an HTML table using the Data Binding architecture of Microsoft Internet Explorer 4.0.
Author Title Price Publisher

The following <APPLET> tag invokes the XML DSO:

<applet code=com.ms.xml.dso.XMLDSO.class width=100% height=25 id=xmldso MAYSCRIPT> <PARAM NAME="url" VALUE="books.xml"> </applet>

The following table binds to the data provided by the XML DSO:

<table id=table border=2 width=100% datasrc=#xmldso cellpadding=5> <thead> <tr> <th>Author</th> <th>Title</th> <th>Price</th> <th>Publisher</th> </tr> </thead> <tr> <td valign=top><div datafld=AUTHOR dataformatas=HTML></div></td> <td valign=top><div datafld=TITLE dataformatas=HTML></div></td> <td valign=top><div datafld=PRICE dataformatas=HTML></div></td> <td valign=top><div datafld=PUBLISHER dataformatas=HTML></div></td> </tr> </table>

The XML data is retrieved from a separate XML file. Click the Show XML Data button below to see this data.

This data is interesting because it includes no schema (or DTD) and is not completely regular. Specifically, the PUBLISHER tags are randomly specified and the relative ordering of nodes in the data is not consistent. The DSO first grovels the entire XML tree and generates a schema that it uses to normalize the XML data. Click the Show Schema button below to see the generated schema.

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