HOME

XML Basic
XML HOME
XML Introduction
XML How to use
XML Syntax
XML Elements
XML Attributes
XML Validation
XML Browsers
XML Viewing
XML CSS Display
XML XSL Display
XML Data Islands
XML Parser
XML in Real Life

XML Advanced
XML Namespaces
XML CDATA
XML Encoding
XML Server
XML Applications
XML HTTP
XML Behaviors
XML Technologies

Examples/Quiz
XML Examples
XML Quiz


XML WebRing
Previous 5 Sites
Previous Site
Next Site
Next 5 Sites
Random Site
List Sites
Award Winning Web Host Full Services Including Ecommerce
Please visit our sponsors !

XML in Data Islands

prev next

With Internet Explorer 5.0 and higher, XML can be embedded within HTML pages in Data Islands.


XML Embedded in HTML

The unofficial <xml> tag is used to embed XML data within HTML.

XML data can be embedded directly in an HTML page like this:

<xml id="note">
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
</xml>

Or a separate XML file can be embedded like this:

<xml id="note" src="note.xml">
</xml>

Note that the <xml> tag is an HTML element, not an XML element.


Data Binding

Data Islands can be bound to HTML elements (like HTML tables). 

In the example below, an XML Data Island with an ID "cdcat" is loaded from an external XML file. An HTML table is bound to the Data Island with a data source attribute, and finally the tabledata elements are bound to the XML data with a data field attribute inside a span.

<html>
<body>

<xml id="cdcat" src="cd_catalog.xml"></xml>

<table border="1" datasrc="#cdcat">
<tr>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="TITLE"></span></td>
</tr>
</table>

</body>
</html>

If you are running IE 5.0 or higher, you can try it yourself.

With IE 5.0 and higher you can also view the external XML file.

Also try this example, demonstrating <thead>, <tbody>, and <tfoot>.


prev next

Jump to: Top of Page or HOME or Printer Friendly Printer friendly page


Search W3Schools:


What Others Say About Us

Does the world know about us? Check out these places:

Dogpile Alta Vista MSN Google Excite Lycos Yahoo Ask Jeeves


We Help You For Free. You Can Help Us!


W3Schools is for training only. We do not warrant its correctness or its fitness for use. The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2002 by Refsnes Data. All Rights Reserved


Validate How we converted to XHTML Validate

IISProtect
Password Protect
Your Web Pages



Your own Web Site?

Read W3Schools
Hosting Tutorial



$15 Domain Name
Registration
Save $20 / year!



Advertise
at W3Schools

Only 0.5 CPM



SELECTED LINKS

University Online
Master Degree
Bachelor Degree


Web Software

The Future of
Web Development


Jobs and Careers

Web Security
Web Statistics
Web Standards


PARTNERS

W3Schools
TopXML
VisualBuilder
XMLPitstop
DevelopersDex
DevGuru
Programmers Heaven
The Code Project
Tek Tips Forum
ZVON.ORG
TopXML Search