Advertise Here
Need an introduction to XML Document Object Models? Learn about document object model parsing, how to parse XML document objects using Microsoft XML, how to find DOM parser errors, and how to test for valid XML display errors in documents. - Web03
Extensible Markup Language

Search XML Files:

DEVELOPER CHANNEL
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Find a Web Host With:
CGI Capabilities
Active Server Pages
Windows Hosting
Unix Hosting
Dedicated Servers
     
 Advanced Search
 Be a Commerce Partner















IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

The XML DOM

by Jan Egil Refsnes

prev next

The Document Object Model

The DOM is a programming interface for HTML and XML documents. It defines the way a document can be accessed and manipulated. 

Using a DOM, a programmer can create a document, navigate its structure, and add, modify, or delete its elements.

As a W3C specification, one important objective for the DOM has been to provide a standard programming interface that can be used in a wide variety of environments and applications.

The W3C DOM has been designed to be used with any programming language.


The Node Interface

As you will se in the next section, a program called an XML parser can be used to load an XML document into the memory of your computer. When the document is loaded, it's information can be retrieved and manipulated by accessing the Document Object Model (DOM).

The DOM represents a tree view of the XML document. The documentElement is the top-level of the tree. This element has one or many childNodes that represent the branches of the tree.

A Node Interface is used to read and write (or access if you like) the individual elements in the XML node tree. The childNodes property of the documentElement can be accesses with a for/each construct to enumerate each individual node.

The Microsoft XML parser used to demonstrate the DOM in this Web, supports all the necessary functions to traverse the node tree, access the nodes and their attribute values, insert and delete nodes, and convert the node tree back to XML.

All the demonstrated Microsoft XML parser functions are from the official W3C XML DOM recommendation, apart from the load and loadXML functions. (Believe it or not: The official DOM does not include standard functions for loading XML documents !!)

A total of 13 node types are currently supported by the Microsoft XML parser. The following table lists the most commonly used node types:

Node Type Example
Document type <!DOCTYPE food SYSTEM "food.dtd">
Processing instruction <?xml version="1.0"?>
Element <drink type="beer">Carlsberg</drink>
Attribute type="beer"
Text Carlsberg

To view the examples in this Web, you have to use Microsoft Internet Explorer 5.0 !


prev next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New at Developer.com/Voice/
- Designing an Interactive Voice Response System Using VoiceXML and CCXML
- Nominations for Developer.com Product of the Year Begin October 15
- Speech Authentication Strategies, Risk Mitigation, and Business Metrics
- Implementing Extension Methods in VB.NET
 DevX XML Content 
- Processing Linked Web Data with XSLT
- Using StAX to Clone an XML Document
- Ten Pitfalls of Enterprise Ontology Management
- WPF Meets the iPhone
- The Easiest and Most Efficient Way to Modify XML Documents

Jump to : Top Of Page or HOME




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES