Skip to main content

Posts

Showing posts with the label SAX

DOM Parser Vs. SAX Parser

Many developers sometimes confuse which is better to parse the XML document. Ofcourse myself also got doubt which parser I can use for this situation.  Since I have read about DOM and SAX very long back. Just refreshing it again DOM (Document Object Model) Parser: Tree model parser(Object based) (Tree of nodes). DOM loads the file into the memory and then parse the file. Has memory constraints since it loads the whole XML file before parsing. DOM is read and write (can insert or delete the node). If the XML content is small then prefer DOM parser. Backward and forward search is possible for searching the tags and evaluation of the information inside the tags. So this gives the ease of navigation. Slower at run time.

Processing XML with Java

A book by Elliotte Rusty Harold, is a complete tutorial about writing Java programs that read and write XML documents. This is the most comprehensive and up-to-date book about integrating XML with Java (and vice versa) you can buy. It contains over 1000 pages of detailed information on SAX, DOM, JDOM, JAXP, TrAX, XPath, XSLT, SOAP, and lots of other juicy acronyms. This book is written for Java programmers who want to learn how to read and write XML documents from their code. Read..