Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book