Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Java parser

Ads

 
 

Share on Google+Share on Google+

samar
Java parser
1 Answer(s)      6 years and 10 months ago
Posted in : Java Interview Questions
What is the difference between DOM and SAX?
Ads
View Answers

October 28, 2010 at 3:40 PM


Hi,

Here is the answer.

  1. sax is an event based parser and raise an event, while dom is not.
  2. sax is forward only where as dom can acess both was forward as well as backwards.
  3. sax parses the file as it reads where as the dom loads the file into memory to parse the file.
  4. Sax does not have memory constraints where as the dom has momory constraints as xml file is loaded into the momory to parse the file.
  5. sax is read only , dom is read and write both.
  6. if you have to parse and use the content only once , consider using sax if the xml file and content are used extensively then consider using dom.

Thanks.


Ads









Related Tutorials/Questions & Answers:
Java parser
Java parser  What is the difference between DOM and SAX
Java XML parser
Java XML parser  Hi friends, i am new to java XML parsing. i need to parse the following xml response which i got from a url hit: <response> <status>SUCCESS</status> <app-config> <CHECK_LOW_SCORE>
Advertisements
Reading xml file using dom parser in java with out using getelementby tag name
Reading xml file using dom parser in java with out using getelementby tag name  Hi, How to read the xml file using java with dom parser, but without... found some thing in the below url : http://www.roseindia.net/answers/viewqa/Java
parser - XML
parser  how to convert XML file to flat file(text file) using DOM and SAX parser
Xml Parser
Xml Parser  Hi... please tell me about What parser would you use for searching a huge XML file? Thanks
Version of pull-parser>pull-parser dependency
List of Version of pull-parser>pull-parser dependency
parser jquery css
parser jquery css  How to parser jquery in css
sax parser for xml
sax parser for xml  sax parser code that works with any XML i.e independent of any XML to extract data from XML
Artifacts of pull-parser
List of Artifacts of pull-parser maven depenency
parser error xmlparseentityref no name
parser error xmlparseentityref no name  While parsing the error in my mobile application ..i'm getting the following error.. "parser error xmlparseentityref no name" and that is because of "&". I have also tried the "&
parser xml one page to another
parser xml one page to another  parser xml one page to another
Prolog Parser Implementation
Prolog Parser Implementation  Hi I am trying to implement a parser for a simple language with grammar like this. program ::= "program" declarations "begin" statements "end" declaration ::= "var" ident "as" type type
Maven Dependency pull-parser >> 2
You should include the dependency code given in this page to add Maven Dependency of pull-parser >> pull-parser version2 in your project
Maven Dependency pull-parser >> 2.1.10
You should include the dependency code given in this page to add Maven Dependency of pull-parser >> pull-parser version2.1.10 in your project
SAX Parser exception
SAX Parser exception  I am trying to validate one xml, its giving me exception as : cvc-elt.5.2.2.1:The value '00' of element 'abcd' does not match the fixed {value constraint} '0'. Please help me asap
Version of com.nativelibs4java>jnaerator-parser dependency
List of Version of com.nativelibs4java>jnaerator-parser dependency
Version of batik>batik-parser dependency
List of Version of batik>batik-parser dependency
Version of ai.h2o>h2o-avro-parser dependency
List of Version of ai.h2o>h2o-avro-parser dependency
Version of ai.h2o>h2o-orc-parser dependency
List of Version of ai.h2o>h2o-orc-parser dependency
Version of ai.h2o>h2o-parquet-parser dependency
List of Version of ai.h2o>h2o-parquet-parser dependency
Version of cat.inspiracio>html-parser dependency
List of Version of cat.inspiracio>html-parser dependency
Version of cat.inspiracio>url-parser dependency
List of Version of cat.inspiracio>url-parser dependency
Version of com.arakelian>graphql-parser dependency
List of Version of com.arakelian>graphql-parser dependency
Version of com.dongxiguo>auto-parser dependency
List of Version of com.dongxiguo>auto-parser dependency
Version of com.ftpix.>sherdog-parser dependency
List of Version of com.ftpix.>sherdog-parser dependency
Version of com.jaredrummler>apk-parser dependency
List of Version of com.jaredrummler>apk-parser dependency
Version of com.nativelibs4java>jnaerator-parser dependency
List of Version of com.nativelibs4java>jnaerator-parser dependency
Version of com.sdl>odata_parser dependency
List of Version of com.sdl>odata_parser dependency
Version of com.sonalake>utah-parser dependency
List of Version of com.sonalake>utah-parser dependency
Version of com.tmiyapub>kvlog-parser dependency
List of Version of com.tmiyapub>kvlog-parser dependency
Version of com.tupilabs>testng-parser dependency
List of Version of com.tupilabs>testng-parser dependency