Home arrow XML arrow Roaming through XMLDOM: An AJAX Prerequisite
XML

Roaming through XMLDOM: An AJAX Prerequisite


The twin tasks of the XMLHttp are handling the HTTP request, and then processing the XML response. The first one is easily done by writing the appropriate syntax for creating this object. This is what is accomplished in AJAX by invoking the new constructor for XMLHTTP object. This is but one of the objects of the XMLDOM -XML Document Object Model. In this article, we look at XMLDOM in some detail before calling the XML document in an AJAX rendition in a future article.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 19
February 20, 2006
TABLE OF CONTENTS:
  1. · Roaming through XMLDOM: An AJAX Prerequisite
  2. · Getting at the Innards of an XML Document
  3. · Continuing the Dissection
  4. · Manipulating the XML Document

print this article
SEARCH DEVARTICLES

Roaming through XMLDOM: An AJAX Prerequisite
(Page 1 of 4 )

A quick look at XMLDOM

The DOM of HTML and XMLDOM share some common traits. The basic precept that documents are hierarchically structured with nodes and nested nodes is common to both of them. The DOM object model as seen in W3C documentation is described in full here.

XMLDOM can be understood through two types of metaphors, a tree representation and a family representation. In the tree representation, the tree has nodes. Nodes can have other nodes growing out of them, or a node can stand by itself without any other nodes sprouting from it. In the family metaphor you have parents, children, siblings, and so on.

Accessing XML via XMLDOM is facilitated by ActiveX. All that is needed is to create a new ActiveXObject, via the call:

var xml_doc=new ActiveXObject ("Microsoft.XMLDOM");

Once this is created, an XML document from a given location can be loaded. Then we can look at the various properties of this object as detailed in the XMLDOM. The following listing gives a brief description of the XMLDOM objects that are well suited for client side scripting.

In XMLDOM as well as HTML's DOM the following interfaces are used for accessing. In the present tutorial we will only look at a subset of the properties and methods of the highlighted objects.

  • Attr
  • CharacterData
  • Comment
  • DocumentFragment
  • Document
  • DOMException
  • DOMImplementation
  • Element
  • Node
  • NodeList
  • NamedNodeMap
  • Text
 

Document

Document is the root of the XML document.

Element

The element object represents the Document's various elements, such as root and other elements.

Node

"Node" is a single node in the document tree representation. This has support for data types, namespaces, DTDs and XML Schemas.

Attribute

"Attribute" represents the single attribute node of an element.

Text

"Text" represents the text of an element or attribute.


blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials