DOM – Document Object Module

According to the DOM, everything in an XML document is a node.
The DOM says:

  • The entire document is a document node
  • Every XML element is an element node
  • The text in the XML elements are text nodes
  • Every attribute is an attribute node
  • Comments are comment nodes

Example :

<Bollywood>
<Movie name="RaOne">
Going to release in Dec 2011
<Actor>
	Shahrukh Khan
</Actor>
<Production>
	Red Chilly
</Production>
</Movie>
</BollyWood>

Diagramatical representation of DOM

As shown in above example and image:

  • Parent Element name is “Movie”.
  • This Element have attribute, which is “name” and attribute has a value “RaOne”.
  • This Element has a text “Going to release in Dec2011″ which is Text Node.
  • The element has two child nodes: Actor and Production which are known as Element Node.
  • Element “Actor” has text node “Sharukh Khan” and Element “Production” has text node “Red Chilly”.

Posted

in

by

Tags:


Related Posts

Comments

3 responses to “DOM – Document Object Module”

  1. […] to JAXP Posted by Jitendra Zaa on March 22nd, 2011 Previous article was about the introduction to DOM. in this article i will focus on DOM handling in […]

  2. […] What is DOM and its structure […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading