JAXB vs SAX - does JAXB need to map enitre document?
361137May 4 2011 — edited May 4 2011I 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?