Previous Next

XML Data Source Applet

Example 2

This example shows how the XML DSO can get the XML data from inside the <APPLET> tag in the HTML page instead of from a separate file.

Number, the Language of Science Danzig 5.95 Tales of Grandpa Cat Wardlaw, Lee 6.58 Evolution of Complexity in Animal Culture Associated Press Bonner 5.95 When We Were Very Young Milne, A. A. 12.50 Learn Java Now Stephen R. Davis Microsoft Corporation 9.95 Design Patterns Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides Addison Wesley 49.95
Author Title Price Publisher

The following <APPLET> tag invokes the XML DSO and loads the XML data:

<applet code=com.ms.xml.dso.XMLDSO.class width=100% height=25 id=xmldso mayscript=true> <?XML VERSION="1.0" RMD="NONE"?> <BOOKS> <ITEM> <XTITLE>Number, the Language of Science</XTITLE> <AUTHOR>Danzig</AUTHOR> <PRICE>5.95</PRICE> </ITEM> <ITEM> <XTITLE>Tales of Grandpa Cat</XTITLE> <AUTHOR>Wardlaw, Lee</AUTHOR> <PRICE>6.58</PRICE> </ITEM> <ITEM> <XTITLE>Evolution of Complexity in Animal Culture</XTITLE> <PUBLISHER>Associated Press</PUBLISHER> <AUTHOR>Bonner</AUTHOR> <PRICE>5.95</PRICE> </ITEM> <ITEM> <XTITLE>When We Were Very Young</XTITLE> <AUTHOR>Milne, A. A.</AUTHOR> <PRICE>12.50</PRICE> </ITEM> <ITEM> <XTITLE>Learn Java Now</XTITLE> <AUTHOR>Stephen R. Davis</AUTHOR> <PUBLISHER>Microsoft Corporation</PUBLISHER> <PRICE>9.95</PRICE> </ITEM> <ITEM> <XTITLE>Design Patterns</XTITLE> <AUTHOR>Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides</AUTHOR> <PUBLISHER>Addison Wesley</PUBLISHER> <PRICE>49.95</PRICE> </ITEM> </BOOKS> </applet>

Note: Because currently the <TITLE> tag is not allowed inside inline XML, XTITLE is used here.

The table that binds to the data is the same one used in Example 1.

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