File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes JAXP or JAXB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXP or JAXB" Watch "JAXP or JAXB" New topic
Author

JAXP or JAXB

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Guys,

In what scenarios do we prefer JAXP over JAXB? I'm currently exploring on JAXB to perform a task and as far as I read through JAXB, I understand that XML processing is straight forward without the need to use SAX or DOM. Given this advantage, what is the need for JAXP?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
There are few things that come only with advantages, and no disadvantages :-)

Having JAXB create all those objects carries a performance overhead, plus the need to have all those classes in the first place. Also, SAX code is more stable in the face of changing document structure - if you use JAXB, then your classes need to match the document, or there'll be problems.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXP or JAXB