Open Directory Site XML Tutorials

ASP | XML | VBScript | JavaScript | ADO | CSS | XMLDOM | PHP | Operating Systems

Home >> XML >>XML in Data Islands

XML in Data Islands

 

With Internet Explorer 5.0, 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>

Cheap Web Hosting Articles - Web Site Design & Web Hosting Tutorials - Domain Hosting