Home arrow XML arrow Page 7 - Displaying ADO Retrieved Data with XML Islands
XML

Displaying ADO Retrieved Data with XML Islands


An XML data island is a piece of well-formed XML embedded into an HTML file. This article will show you how to retrieve data in an XML format from a database using ADO; you will also learn how to bind this data into an HTML document.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
September 06, 2006
TABLE OF CONTENTS:
  1. · Displaying ADO Retrieved Data with XML Islands
  2. · Extracting XML formatted data example
  3. · The Saved XML file
  4. · Reviewing the saved file
  5. · Data types in Access 2003 and XML file
  6. · Displaying retrieved XML in an HTML document
  7. · Creating an HTML document which can display the XML Data

print this article
SEARCH DEVARTICLES

Displaying ADO Retrieved Data with XML Islands - Creating an HTML document which can display the XML Data
(Page 7 of 7 )

AdoIsland.html

In the code shown next, insert the XML data island created in the previous section and save it as AdoIsland.htm. Make sure the DATASRC attribute of the table corresponds to the ID field of the XML Data Island. The DATAFIELD attribute refers respectively to the data fields in the XML data island.

<html><head><title></title></head>
<body>
<table DATASRC="#Test">
<tr>
<tr><td>
<table DATASRC="#Test" DATAFLD="rs:data" border="1"
bgcolor="yellow">
<tr><td>
<table DATASRC="#Test" DATAFLD="z:row">
<tr>
<td><span DATAFLD="EmployeeID"></span</td>
<td><span DATAFLD="FirstName"></span</td>
<td><span DATAFLD="LastName"></span</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
<!--Here plug in the XML Data Island -->
</body>
</html>

Displaying the XML Data retrieved on the IE

Now if you browse the AdoIsland.htm file the display should appear as follows. If you refer to the table above, you can see that although all fields are in the XML Data Island, only three of them are called while displaying.

Displaying the image saved as an embedded BMP file

From the XML file you could retrieve the field for the 'Photo' and display the image on the browser. For this, you need to add another cell to the table and insert the following for the cell.

<td><img src=""  DATAFLD="Photo"></td>

With the above table cell added to the table, the display now appears as shown here. For this to display correctly you should have the corresponding BMP file at the same location as the AdoIsland.htm file.

Summary

This tutorial extends the previous tutorial to show how to access data and display it using the ADO's save() method. An example to display the persisted data using the XML Data Island was described. More importantly, the data types in MS Access as they relate to data types in the persisted XML file were shown in detail. Similar ideas will help in accessing data from a web server with Active Server Pages as well.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials