GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  Oracle  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 6 of 134    Print  
Difference between SAX and DOM?

  
Total Answers and Comments: 4 Last Update: December 15, 2005   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 08, 2005 01:37:54   #1  
pravash        

RE: Difference between SAX and DOM?
SAX uses an event callback mechanism requiring you to code methods to handle events thrown by the parser as it encounters different entities within the XML document. 
DOM parses an XML document and returns an instance of org.w3c.dom.Document. This document object's tree must then be "walked" in order to process the different elements. 
 

 
Is this answer useful? Yes | No
June 08, 2005 03:27:10   #2  
shashidhar Mahavadi        

RE: Difference between SAX and DOM?
SAX parser requires to implement an event handler 
DOM object is an object in memory representing the parsed xml file and DOM object is actualy built up using SAX 



Your valueable suggessions are welcome

 
Is this answer useful? Yes | No
July 16, 2005 03:37:48   #3  
swamy reddy        

RE: Difference between SAX and DOM?
sax parser is used for only java-xml programms only. 
dom parser is for any lanaguage that is associated with xml concepts.

 
Is this answer useful? Yes | No
December 15, 2005 12:06:45   #4  
Habeeb Mohmed        

RE: Difference between SAX and DOM?

SAX Historical Background

! Simple API for XML

! Started as community-driven project

  "xml-dev mailing list

! Originally designed as Java API

  "Others (C++, Python, Perl) are now

supported

! SAX 2

  "Namespaces

 

SAX Features

! Event-driven

  "You provide event handlers

! Fast and lightweight

  "Document does not have to be entirely in memory

! Sequential read access only

! One-time access

! Does not support modification of document

 

 

Historical Background

l DOM is a standard defined by the

W3C, just like XML

l DOM was not designed specifically for

Java technology (unlike SAX)

l DOM is cross-platform and crosslanguage

uUses OMG’s IDL to define interfaces

uIDL to language binding

 

DOM Characteristics

l Access XML document as a

tree structure

l Composed of mostly element nodes

and text nodes

l Can “walk” the tree back and forth

l Larger memory requirements

uFairly heavyweight to load and store

l Use it when for walking and modifying

the tree


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape