O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required