Skip navigation

Exploring Data Islands

Internet Explorer XML Data Islands

Troubleshooting Tips

LANGUAGES: ALL

ASP.NET VERSIONS: ALL

 

Exploring Data Islands

Internet Explorer XML Data Islands

 

By Don Kiely

 

In the last couple of columns I've talked about useful ways to display XML data in a browser, including using the innerHTML attribute of many controls and the XML ASP.NET server control. Another option is to embed the XML data within the Web page itself, either as part of a static page (one dynamically generated each time the page is requested), or even using Dynamic HTML on the client. IE 4 and later supports data islands, units of XML data within a Web page.

 

An XML data island uses an HTML tag to embed XML within the page itself when it's delivered from the Web server to the browser. Here's how a page with a data island would look (the number of customer records has been shortened to save space):

 

  

    Data Island - Inline

    

      rel="stylesheet">

  

  

    

Data Island: Inline

    

Return to Default

    

      

      

        

          Morris

          Barbara

        

        

          Konick

          Greg

        

      

    

    

      border="1"">

      

        

        

      

    

  

 

There are several structural details to notice about this HTM file:

  • The tag delineates well-formed XML data that is embedded in the page.
  • The tag's id attribute names the data island xmlCustomers so you can refer to the data in client or server code.
  • This example uses a data source object - a feature of IE for processing data records - to automatically parse and use the XML data.

 

The figure below shows how IE displays this page. The HTML table reads the XML data, referring to the defined name xmlCustomers to populate the table cells.

 


 

There are two other ways to use data islands in Internet Explorer: using the tag and overloading the

 

  

Data Island: DOM

  

Return to Default

  

    ondatasetcomplete="ShredXML();">

  

 

The result of running this page is the same as that shown in the previous figure.

 

There are many ways to display and use XML in .NET. Any of the techniques require that you know the various ways that .NET handles different types of data, as well as its support for the string data type and various types of streams. But once you sort all that out, ASP.NET has plenty of ways to get your data into users' heads.

 

Don Kiely is senior technology consultant for Information Insights, a business and technology consultancy in Fairbanks, AK. E-mail him at mailto:[email protected].

 

 

 

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish