Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
Java parser
1 Answer(s)      4 years and 2 months ago
Posted in : Java Interview Questions


What is the difference between DOM and SAX?

Advertisement
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.



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
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
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 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
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 "&
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
parser xml one page to another
parser xml one page to another  parser xml one page to another
write a jsp parser
write a jsp parser  I want figure out the variable used in a particular jsp and put it in a xml.I can do it manually but there are whote lot of a jsp to figure out .So can anyone can tell me a option to build a jsp parser
SAX Parser for huge XML file
using dom parser in java. import org.w3c.dom.*; import org.w3c.dom.Node; import...SAX Parser for huge XML file  Hi.... if the XML file is small... = SAXParserFactory.newInstance(); SAXParser parser = parserFact.newSAXParser
SAX Parser
SAX Parser       The Simple API for XML (SAX) is a serial access parser API for XML. It is used... executes, the SAX parser recognizes and responds to each XML structure taking
JavaScript XML Parser
JavaScript XML Parser    ... to access and manipulate XML document using DOM parser in javascript. XML parser... that the parser continues the script execution after loading of the document fully
how to design a parser - Design concepts & design patterns
how to design a parser  sorry i am not sure in which category i have to put my question actually i have to design a LR (0) parser for a given grammar in java i am confused how to implement this i know how the parser
XML Parsing Using Sax Parser in J2ME for serverside
XML Parsing Using Sax Parser in J2ME for serverside  Hai team, i have doubt in Parsing using sax parser in serverside plz help me for xml parsing in j2me using sax parser on server side thanks in advance... regards Selva
JAXP API using DOM Parser
JAXP API using DOM Parser         Introduction to XML Parser: In computing terms, a parser is a program that takes input in the form of sequential
Truncating issue while parsing XML with SAX Parser.
Truncating issue while parsing XML with SAX Parser.  I am Parsing one xml file and after parsing I have to enter the data into the database using... could understand was while calling the event handler of the SAX Parser i.e.
XML Parsing Using Sax Parser in J2ME
XML Parsing Using Sax Parser in J2ME  Hai team, I hope you, You should help me, I have trouble in Xml parsing... I have decoded value, what my process means to send that value to web services using Get method like
Read Complex XML using DOM/SAX Parser.
Read Complex XML using DOM/SAX Parser.  I have a XML file which is having two types of Items. I want to extract all details of a type only. My XML goes something like this <Movie> <Bollywood> <Actor> Shah Rukh
How to parse the attributes from XML using KXML parser in j2me
How to parse the attributes from XML using KXML parser in j2me  Dear Sir, I have doubt in How to parse the attributes from XML using KXML parser in j2me ..I parse the dge name value..but i didn't do parsing the attributes
Parsing The XML File using DOM parser in JSP
Parsing The XML File using DOM parser in JSP... the DOM (Document Object Model) parser, that is the platform independent... the processing are displayed on to the present page. DOM parser is not an ideal
How to parse the attributes values from XML using KXML parser in j2me
How to parse the attributes values from XML using KXML parser in j2me  hai team, i did xml parsing from serverside...i got a resultant value from... public void parseAddressTag(XmlParser parser) throws IOException
Parsing repeatitive xml elements using SAX Parser - XML
SAX Parser to read an XML file. My XML file contains repeatitive tags. I'm... SAX parser. Thanks. Thanks.  Hi Shailendra, Use the following...(); SAXParser parser = parserFact.newSAXParser(); System.out.println
Java XML Parsing Using SAX
Java XML Parsing Using SAX To Parse XML document using SAX parser method you.... At first Create the SAX Parser as // getting SAXParserFactory instance... java class is given below based on above explanation XmlParsingUsingSax.java
Parsing The XML File Using JDOM Parser in JSP
Parsing The XML File Using JDOM Parser in JSP... with JDOM parser to parse the xml document. JDOM can read existing XML documents... native parser. XML parsing produces an xml parse tree from an XML document. Using
XML- SAX Parser using JAXP API
XML- SAX Parser using JAXP API           XML- SAX Parser using JAXP API In the previous issue of Java Jazz Up you have read about XML technology. In this issue
Java XML modification
Java XML modification This section explain you how to modify the xml file using DOM parser. For this purpose, you have to use DocumentBuilderFactory, DocumentBuilder and Document classes to get the default DOM parser and parse the xml
DOM Parser Example to Parse A DOM Document
DOM Parser Example to Parse A DOM Document In this tutorial, we will discuss...;} } Output: C:\>java Read_PrintXMLFile Root... the XML Code Download the JAVA code/a>
java jsp
java jsp  please I want code to parse a web page using Dom parser, thanks
Advertisements
 

 

 

DMCA.com