DOM – Document Object Module

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with 3 Comments on DOM – Document Object Module

What is DOM in JAVA. DOM stands for 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 :

<Movie name="RaOne">
Going to release in Dec 2011
	Shahrukh Khan
	Red Chilly

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”.

Related posts

3 thoughts on “DOM – Document Object Module”

Leave a Reply

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