XML Integration with ADO - Easy as 1,2,3
(Page 3 of 4 )
We have several bound tables, using successive levels in the XML data as the source of the data. So we would end up with something that looks like below on IE, when we load BindingHierarchialData.html.

All that we have done is add some bound tables to HTML. The Data Island supplies the data. If you think that the above output doesn’t look so dignified, don’t worry. With a little help formatting we can set things straight and achieve really good-looking results. Now we have a Publishers table populated with all the above-specified fields and each publisher with a list of books published.
Assume the Publisher, “McGraw Hill” has the following books published: HTML-Virtual Classroom, Java In 21 days, SQL Server Programming, Instant ASP Scripts and XML Complete. For each publisher, there should be two sub-tables. One should hold the populated values for the employee and the other populated with values of sales. For each sale, we try and maintain another table containing the details of the books sold. This too has been populated.

Levels of Hierarchy
If you find HTML data binding is getting a little confusing you can include the levels of hierarchy in the DATAFLD attribute to make life much simpler and a little clearer. For example let us consider the following example 2:
<TABLE ID = “tblPublishers” DATASRC = “#diPublishers”>
<TABLE DATASRC = “#diPublishers” DATAFLD = “Title”>
<TABLE DATASRC = “#diPublishers” DATAFLD = “Title.sale”>
<TABLE DATASRC = “#diPublishers” DATAFLD = “Employee”
The above change doesn’t change the way anything works, but it clarifies where “sale” files sit in the hierarchy.
Next: Saving Recordsets as XML >>
More XML Articles
More By Gayathri Gokul