Microsoft XML 2.5 SDK


 

Lesson 3: Authoring XML Data Islands

[This is preliminary documentation and subject to change.]

What is an XML data island?

A data island is an XML document that exists within an HTML page. It allows you to script against the XML document without having to load it through script or through the <OBJECT> tag. Almost anything that can be in a well-formed XML document can be inside a data island.

The XML element marks the beginning of the data island, and its ID attribute provides a name you can use to reference the data island.

The XML for a data island can be either inline:

<XML ID="XMLID">
  <customer>
    <name>Mark Hanson</name>
    <custID>81422</custID>
  </customer>
</XML>

or referenced through a SRC attribute on the XML tag:

<XML ID="XMLID" SRC="customer.xml"></XML>

You can also use the SCRIPT tag to create a data island:

<SCRIPT LANGUAGE="xml" ID="XMLID">
  <customer>
    <name>Mark Hanson</name>
    <custID>81422</custID>
  </customer>
</SCRIPT>

Authoring guidelines

Simply author an XML document, place that XML document within an XML element, and give that XML element an ID attribute.