Previous

XML Data Source Applet

Example 8

This example shows how the JavaScript recordset interface can be used to walk through some XML data one node at a time.
TITLE
AUTHOR
PUBLISHER
PRICE
QUANTITY

In this case the data binding is done as follows:

<table bgcolor=#dddddd border=2 width=100% cellpadding=3> <tr><td><b>TITLE</b></TD> <td><span datasrc=#xmldso datafld=TITLE></span></TD></TR> <tr><td><b>AUTHOR</b></TD> <td><span datasrc=#xmldso datafld=AUTHOR></span></TD></TR> <tr><td><b>PUBLISHER</b></TD> <td><span datasrc=#xmldso datafld=PUBLISHER></span></TD></TR> <tr><td><b>PRICE</b></TD> <td><span datasrc=#xmldso datafld=PRICE></span></TD></TR> <tr><td><b>QUANTITY</b></TD> <td><span datasrc=#xmldso datafld=QUANTITY></span></TD></TR> </table> The code for the buttons that move the recordset is as follows: <input type=button value="Previous" onclick='xmldso.recordset.moveprevious()'> <input type=button value="Next" onclick='xmldso.recordset.movenext()'>

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