Tabular Data Binding and XML

When you bind a recordset to an HTML table, the table can display the entire recordset. Here's an example. In this case, I'll bind the data in ch08_03.xml to a table. I start by creating an XML data island, giving the data island the ID of customers:

<HTML> 
    <HEAD>
        <TITLE>
            Tabular Binding with XML Data Islands
        </TITLE>
    </HEAD>

    <BODY>
        <CENTER>
            <H1>
                Tabular Binding with XML Data Islands
            </H1>

            <XML SRC="ch08_03.xml" ID="customers"></XML>
            .
            .
            .

To bind the data in ch08_03.xml to a table, all I have to do is set a table's DATASRC attribute to customers:

            <XML SRC="ch08_03.xml" ID="customers"></XML> 

             <TABLE DATASRC="#customers" CELLSPACING="10">
             .
             .
             .

The fields in the records of ch08_03.xml are NAME, CUSTOMER_ID, PURCHASE_DATE ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.