Binding XML Data to HTML Pages with the XML Data Source Object

There are three ways to bind XML to an HTML page:

The design team chose the second approach, because it allows the PT application to target a wider range of browsers, namely Internet Explorer 4.0 in addition to Internet Explorer 5. See the XML Developer Center on the MSDN Web site for comprehensive discussions of the other alternatives.

The following diagram illustrates the application's actions from a request for a form to the binding of data to HTML tables.

This diagram shows the following actions:

  1. As gate.asp loads the application's frameset, it populates the left pane with the *list.htm file associated with the form the user has requested. The HTML file contains the XML DSO, which calls ViewData.asp.
  2. ViewData.asp calls Litware.SQLXML, which in turn uses ADO to retrieve the requested recordset from the SQL Server™ 7.0 database.
  3. SQL Server returns the records through the Litware.SQLXML component, which uses database column names to format the data into XML. ViewData.asp then returns the XML stream to the XML DSO, which binds the records to the HTML file by matching the XML tags to target attributes in the HTML table.
  4. A fully populated list appears in the application's left pane.

This technique is an alternative to the approach to database connectivity used in Scenario 1: Corporate Media Library. Scenario 1 implemented data sorting on the client using Remote Data Services (RDS) ActiveX controls.

See Data Binding Intrinsic HTML Objects to xmldso for a discussion of this feature's implementation details.