Home arrow XML arrow Page 6 - 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 - Displaying retrieved XML in an HTML document
(Page 6 of 7 )

Creating an XML Data Island

From the previous tutorial we know that we need to embed the XML in an XML document to produce the XML Data Island. The ADO's save() method does not produce a data island. This can be built in two steps. First of all, to associate the 'Data' contained in the XML to the bondable tags of the HTML, we need a basis of association. This is given by the following XML block with the id='test.'

<XML id="test">
 
 
</XML>

In the second step, you will notice that XML is already the first tag in the saved file. Since you cannot have two XML tags, you modify the saved file by prefixing ado to xml and changing it to adoxml as shown. This will be embedded in the previous block and the resulting XML is the XML Data Island.

<adoxml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
        xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
        xmlns:rs='urn:schemas-microsoft-com:rowset'
        xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
        <s:ElementType name='row' content='eltOnly' rs:updatable='true'>
               <s:AttributeType name='Address' rs:number='8' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Address'>
                       <s:datatype dt:type='string' dt:maxLength='60'/>
               </s:AttributeType>
               <s:AttributeType name='BirthDate' rs:number='6' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='BirthDate'>
                       <s:datatype dt:type='dateTime' 
rs:dbtype='variantdate' dt:maxLength='16' rs:fixedlength='true'/>
               </s:AttributeType>
               <s:AttributeType name='City' rs:number='9' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='City'>
                       <s:datatype dt:type='string' dt:maxLength='15'/>
               </s:AttributeType>
               <s:AttributeType name='Country' rs:number='12' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Country'>
                       <s:datatype dt:type='string' dt:maxLength='15'/>
               </s:AttributeType>
               <s:AttributeType name='EmployeeID' rs:number='1' 
rs:maydefer='true' rs:writeunknown='true' rs:basetable='Employees'
                        rs:basecolumn='EmployeeID' 
rs:autoincrement='true'>
                       <s:datatype dt:type='int' dt:maxLength='4' 
rs:precision='10' rs:fixedlength='true'/>
               </s:AttributeType>
               <s:AttributeType name='Extension' rs:number='14' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Extension'>
                       <s:datatype dt:type='string' dt:maxLength='4'/>
               </s:AttributeType>
               <s:AttributeType name='FirstName' rs:number='3' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='FirstName'>
                       <s:datatype dt:type='string' dt:maxLength='10'/>
               </s:AttributeType>
               <s:AttributeType name='HireDate' rs:number='7' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='HireDate'>
                       <s:datatype dt:type='dateTime' 
rs:dbtype='variantdate' dt:maxLength='16' rs:fixedlength='true'/>
               </s:AttributeType>
               <s:AttributeType name='HomePhone' rs:number='13' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='HomePhone'>
                       <s:datatype dt:type='string' dt:maxLength='24'/>
               </s:AttributeType>
               <s:AttributeType name='LastName' rs:number='2' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='LastName'>
                       <s:datatype dt:type='string' dt:maxLength='20'/>
               </s:AttributeType>
               <s:AttributeType name='Notes' rs:number='16' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Notes'>
                       <s:datatype dt:type='string' 
dt:maxLength='536870910' rs:long='true'/>
               </s:AttributeType>
               <s:AttributeType name='Photo' rs:number='15' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Photo'>
                       <s:datatype dt:type='string' dt:maxLength='255'/>
               </s:AttributeType>
               <s:AttributeType name='PostalCode' rs:number='11' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='PostalCode'>
                       <s:datatype dt:type='string' dt:maxLength='10'/>
               </s:AttributeType>
               <s:AttributeType name='Region' rs:number='10' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Region'>
                       <s:datatype dt:type='string' dt:maxLength='15'/>
               </s:AttributeType>
               <s:AttributeType name='ReportsTo' rs:number='17' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='ReportsTo'>
                       <s:datatype dt:type='int' dt:maxLength='4' 
rs:precision='10' rs:fixedlength='true'/>
               </s:AttributeType>
               <s:AttributeType name='Title' rs:number='4' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
rs:basetable='Employees'
                        rs:basecolumn='Title'>
                       <s:datatype dt:type='string' dt:maxLength='30'/>
               </s:AttributeType>
               <s:AttributeType name='TitleOfCourtesy' rs:number='5' 
rs:nullable='true' rs:maydefer='true' rs:write='true'
                        rs:basetable='Employees' 
rs:basecolumn='TitleOfCourtesy'>
                       <s:datatype dt:type='string' dt:maxLength='25'/>
               </s:AttributeType>
               <s:extends type='rs:rowbase'/>
        </s:ElementType>
</s:Schema>
<rs:data>
        <z:row Address='4110 Old Redmond Rd.' 
BirthDate='1958-09-19T00:00:00' City='Redmond' Country='USA'
EmployeeID='4'
                Extension='5176' FirstName='Margaret' 
HireDate='1993-05-03T00:00:00' HomePhone='(206) 555-8122'
LastName='Peacock'
                Notes='Margaret holds a BA in English literature from 
Concordia College and an MA from the American Institute of Culinary Arts.
She was temporarily assigned to the London office before returning to her
permanent post in Seattle.'
                Photo='EmpID4.bmp' PostalCode='98052' Region='WA' 
ReportsTo='2' Title='Sales Representative' TitleOfCourtesy='Mrs.'/>
</rs:data>
</adoxml>


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