XML
  Home arrow XML arrow Introduction to XML Document Object Model
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Introduction to XML Document Object Model
By: Gayathri Gokul
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 15
    2004-02-09

    Table of Contents:
  • Introduction to XML Document Object Model
  • Covering Our Base
  • DOM Simplified
  • Working With XML Data
  • Traversing the Nodes in an XML Document

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Introduction to XML Document Object Model


    (Page 1 of 5 )

    Learn about XML and the hierarchical structure of the Document Object Model in this down and dirty piece! Nodes, NodeLists, NameNodeMaps, as well as properties such as parentNodes, childNodes, nodeNames, and nodeValues are explored, explained and code is given. "In order to represent the hierarchical nature of XML, the DOM provides a whole set of objects, methods and properties that allow us to manipulate the DOM. We will not be able to cover them all in this tutorial, but we’ll cover a few to give you the essence of the sort of things you can achieve."

    The Document Object Model is an API for HTML and XML documents.  It defines the logical structure of the documents, and the way they can be accessed. DOM gains its importance because it defines a standard way in which you can access and manipulate the XML structure. In short we can say DOM is a programming interface for XML documents and also defines the way an XML document can be accessed and manipulated. A simple illustration will help us understand about the XML document, and how the DOM can be used.

    Example 1


    <BookAuthors>
     
    <Author>
      
    <au_id>1001</au_id>
      
    <au_lnameGates </au_name>
      
    <au_fnameBill </au_name>
     
    </Author>
     
    <Author>
      
    <au_id>1002</au_id>
      
    <au_lnamePotter</au_name>
      
    <au_fnameHarry </au_name>
     
    </Author>
    </BookAuthors>

    If you take a closer look you will be able to see that XML documents are always hierarchical in nature, which means they always have a top-level or root element and then child elements. So the above document could be represented as:

    XML DOM

    The tree would have been deeper, if there were more children. In DOM terms these elements are also called nodes. A node just represents a generic element in this tree-type structure.

    More XML Articles
    More By Gayathri Gokul


     

    XML ARTICLES

    - More on Triggers and Styles and Control Temp...
    - Looking at Triggers with Styles and Control ...
    - A Closer Look at Styles and Control Templates
    - Styles and Control Templates
    - Properties and More in XAML
    - Elements and Attributes in XAML
    - XAML in a Nutshell
    - Importing XML Files into Access 2007
    - Using MSXML3.0 with VB 6.0
    - MSXML, concluded
    - MSXML, continued
    - MSXML Tutorial
    - Generating XML Schema Dynamically Using VB.N...
    - XSL Transformations using ASP.NET
    - Applying XSLT to XML Using ASP.NET





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway