cancel
Showing results for 
Search instead for 
Did you mean: 

Best method

Former Member
0 Kudos

Hi,

What's the most efficient method: SAX, DOM or JAXB?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Indrajit,

I guess u r talkin abt java mapping

It basically boils down to the kind of requirement u have ...

A DOM(Document object model) is a collection of nodes, or pieces of information,organized in a hierarchy. This hierarchy allows a developer to navigate around the tree looking for specific information.

Analyzing the structure normally requires the

entire document to be loaded and the hierarchy to be built before any work is done, the DOM is said to be tree-based,or object-based.

u can use SAX parser for large documents (as parsing and loading the entire document can be slow and resource-intensive).

Hence u have an event-based models, such as the Simple API for XML (SAX), work on a stream of data, processing it as it traverses.

Hope it helps

Regards,

Mohd Tauseef I

Edited by: Mohd Tauseef Ibrahim on Jun 26, 2008 12:27 PM

Answers (3)

Answers (3)

aashish_sinha
Active Contributor
0 Kudos

Hi,

PLease refer http://www.codeproject.com/KB/XML/java_xml-binding_objects.aspx

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

DOM is generally most efficient for small messages, while SAX is more efficient for very large messages. The efficiency depends on size and structure of message to be processed.

Former Member
0 Kudos

Hi,

SAX parser is easy compare to DOM. Its is an easy api and SAX parse if fast in acessing elements. If you want to go back to xml elements move freely top and bottem of xml elements better go for DOM.

Thanks,

RamuV