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




Have Programming Question? Ask it here!
 
 
 


samar
Java parser
1 Answer(s)      3 years and 9 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
Java Interview Questions - Page 2
Java Interview Questions - Page 2       Question: Parsers? DOM vs SAX parser... and applications that process that XML. The parser is responsible
parse map in java
parse map in java  What is a Parser? Can you give the source code to parse map in Java
DOM Parser Tutorial
DOM Parser Tutorial Introduction Dom stands for Document Object Model. It is a Java API(Application Programming Interface ) for XML Parsing... by the parser. It extends Text interface for storing text of CDATASection. CharacterData
Kxml Parser Example
Kxml Parser Example      ... to parse the xml. Through 'catching parsing events', the parser traverses the XML... it encounters particular structures in the data. For example, when the parser
java with xml
java with xml  Hi i am reading xml data with sax parser in java. ok its fine. But in future xsd and xml will change. now my question is if xsd and XML will change my java progrm will not change. is it possible ? Thanks
java with xml
java with xml  Hi i am reading xml data with sax parser in java. ok its fine. But in future xsd and xml will change. now my question is if xsd and XML will change my java progrm will not change. is it possible ? Thanks
java - XML
in java? How can write the same data into XML file using DOM parser? Could you
Java XML
Java XML In this section we will learn how to manipulate XML files in Java program. Java provides excellent API for manipulating the XML files. In your Java... the XML files. API's for XML parsing in Java: DOM The DOM API
XML with JAVA - XML
have a query. "Write program in java to evaluate the time to access... document and the processing in JAVA program . Find the time for each XML element. and compare that which XML parser take how much time ? there are 3 XML PARSER 1
JAVA - Java Beginners
JAVA  How to parse a HTML web page using JAVA?  Hi Friend, Try the following code: import javax.swing.text.html.parser.*; import...:\\page.html"); ParserDelegator parser = new ParserDelegator
XML Expat Library:
XML parser is based on Expat. It lets you parse but not validate XML.... PHP?s XML parser is event-based. In the following example you could learn... is very easy to learn</php><Java>Java is the king of open source
java - XML
java  How can write data into XML file using DOM parser? How can convert HTWL file to XML file
Validation on input xml in java program - XML
Validation on input xml in java program  Hi.. i am accepting xml data as input which I have to use in my program. i have to validate this input xml against some schema using xml beans and NOT by using sax or dom parser. I am
XML Count Elements
; that are used in your XML document using the SAX parser.  Description of program: Developing a java program, you need a XML well-formed document. When you run...(). The startElement method is called by parser each time. When this method overrides the code
J2ME Kxml Example
kxml application, In this application we'll show you how to work with kxml parser... which is published on the website.   Kxml Parser Example... to parse the xml. Through 'catching parsing events', the parser traverses the XML data
CodeSkin for TI C2000 DSP
CodeSkin for TI C2000 DSP        The Eclipse plug-in provides an error parser for the C2000 compiler as well as serial flash programmer (equivalent to C2oooProg
XML Parsers
; XML parser is used to read, update, create and manipulate an XML document. Parsing XML Documents To manipulate an XML document, XML parser is needed. The parser..., its data can be manipulated using the appropriate parser.  We will soon
java - XML
in the XML document while i am parsing the file using SAX event based parser.... provide the way in java.  Hi Friend, Try the following code: import... parser = parserFact.newSAXParser(); System.out.println("XML Data
 

 

 

DMCA.com