Click to return to the XML (Extensible Markup Language) home page    
Lesson 2     Lesson 4     Lesson List    
Web Workshop  |  XML (Extensible Markup Language)

XML Tutorial
Lesson 3: Authoring XML Data Islands


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.

Try it!

In the text box below, type a well-formed XML document.

Input an ID for the data island.



Click the Insert Data Island button to display an HTML page with your data island inserted.



Back to topBack to top

Did you find this material useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.