Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAXB vs SAX - does JAXB need to map enitre document?

361137May 4 2011 — edited May 4 2011
I am facing a situation where I need to decide between JAXB and SAX.

I know they are very different solutions but these two seem to be the best of the two solutions for processing an xml document whether is xml-binding or lowl-level event driven parsing.


I am leaning towards SAX because it is obviously going to be faster. However there may be one additional reason to avoid JAXB and i wanted to get confirmation on this from someone:

If I am using JAXB, do I need to map out the entire document or create an object that has properties for the entire schema?

Basically, I am dealing with a large complex xml document and I only need a small subset of the data within it, so I am wondering if using JAXB I would unnecessarily have to worry about all that data i wouldn't even be caring about or would it let me ignore them anyway sort of like SAX would allow me to do, or would it spit out errors because I did not completely map everything to an object?
This post has been answered by blaise_doughan on May 4 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2011
Added on May 4 2011
1 comment
245 views