Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  XML (Extensible Markup Language)

XML Tutorial
Lesson 4: Accessing an XML Data Island as an XML Document Object


Updated: November 4, 1998

What is an XML document object?

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.

How do I access an XML data island?

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>

Calinda Cabo Baja Na Balam Resort

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

Try it!

Sorry! The interactive exercises require Internet Explorer 5 Beta Non-SBN link.

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!

Back to topBack to top

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

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site