Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Updated: November 4, 1998
An XML document object is an object representing an XML document. When an XML data island is loaded and parsed, the parser creates an XML document object. This object has properties and methods that allow you to access and manipulate the XML document.
An HTML page with a data island is shown below.
<HTML> <HEAD> <TITLE>HTML with XML Data Island</TITLE> </HEAD> <BODY> <P>Within this document is an XML data island.</P> <XML ID="resortXML"> <resorts> <resort>Calinda Cabo Baja</resort> <resort>Na Balam Resort</resort> </resorts> </XML> </BODY> </HTML>
You can access the data island by ID. From there you can access its root node and subsequent child nodes. The following code returns the string "Na Balam Resort":
resortXML.documentElement.childNodes.item(1).text
Sorry! The interactive exercises require Internet Explorer 5 Beta .
For more practice working with the XML object model, see the Tree Viewer sample in the Samples section of Site Builder Network.
Did you find this article useful? Gripes? Compliments? Suggestions for other articles? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.