Tabular Data Binding with the XML DSO

It's as easy to bind the XML DSO to tables as it was to bind XML data islands to tables. Here's an example showing how this works. In this case, I'm just binding ch08_03.xml to a table using the XML DSO, and I'm displaying all the fields in the various records of ch08_03.xml at once:

Listing ch08_08.html
 <HTML>     <HEAD>         <TITLE>             Binding the XML DSO to Tables         </TITLE>     </HEAD>     <BODY>         <CENTER>             <H1>                 Binding the XML DSO to Tables             </H1>             <APPLET CODE="com.ms.xml.dso.XMLDSO.class"                 ID="customers"                 WIDTH="0" HEIGHT="0"                 MAYSCRIPT="true">                 <PARAM NAME="URL" VALUE="ch08_03.xml">             </APPLET>              <TABLE DATASRC="#customers" CELLSPACING="10">                  <THEAD>                      <TR>                          <TH>Name</TH>                          <TH>Customer ID</TH>                          <TH>Purchase Date</TH>                          <TH>Department</TH>                          <TH>Product</TH>                      </TR>                   </THEAD>                   <TBODY>                       <TR>                           <TD>                               <SPAN DATAFLD="NAME">                               </SPAN>                           </TD>                           <TD>                               <SPAN DATAFLD="CUSTOMER_ID">                               </SPAN>                           </TD>                           <TD>                               <SPAN DATAFLD="PURCHASE_DATE">                               </SPAN>                           </TD>                           <TD>                               <SPAN DATAFLD="DEPARTMENT">                               </SPAN>                           </TD>                           <TD>                               <SPAN DATAFLD="PRODUCT_NAME">                               </SPAN>                           </TD>                        </TR>                   </TBODY>             </TABLE>         </CENTER>     </BODY> </HTML> 

That's all it takes. You can see this page in action in Figure 8-6.

Figure 8-6. Tabular data binding with the XML DSO in Internet Explorer.

graphics/08fig06.gif



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net