Previous Next

XML Data Source Applet

Example 3

This example shows how to use the XML DSO to bind nested tables to hierarchical XML data. Click the Show XML Data button below to see this data. The XML data contains a list of Customers, each of which contains a list of Orders, each of which contains a list of Items. In all, there are three levels of repetition bound to three nested tables.

The <APPLET> tag in this example is as follows:

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

Then there are three nested tables that bind to the three nested ROWSETS defined in the above schema:

<table id=table datasrc=#xmldso border=2 width=100% cellpadding=3> <tr><td valign=top><div datafld=NAME></div></TD> <td valign=top> <table border=2 width=100% cellpadding=3 datasrc=#xmldso datafld=ORDER> <tr><td valign=top><div datafld=DATE dataformatas=HTML></DIV></TD> <td valign=top><table border=2 width=100% cellpadding=3 datasrc=#xmldso datafld=ORDER.ITEM> <tr><td valign=top><div datafld=TITLE dataformatas=HTML></DIV></TD> <td valign=top><div datafld=AUTHOR dataformatas=HTML></DIV></TD> <td valign=top><div datafld=PRICE dataformatas=HTML></DIV></TD></TR> </table></TD></TR> </table></TD></TR> </table>


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