Is it a better choice to go with JAXB over sax and dom
Is JAXB really a better solution over sax and dom
in the present project we are planning to go with JAXB rather than sax(our xml file is huge)
after some initial study and working around it seems good but i would like to have your opinion on the topic
I am sure there is lot of people out there who have worked with JAXB
Message was edited by:
arunmp25
# 1
use JAXB when you need random access - read/write on an XML. Like DOM, just more efficient.
be aware that JAXB is not a good solution for scenarios where the schema of the XML is likely to change.
do also explore XMLbeans.
> Is JAXB really a better solution over sax and dom
>
> in the present project we are planning to go with
> JAXB rather than sax(our xml file is huge)
>
> after some initial study and working around it seems
> good but i would like to have your opinion on the
> topic
>
> I am sure there is lot of people out there who have
> worked with JAXB
>
> Message was edited by:
> arunmp25
# 2
> in the present project we are planning to go with
> JAXB rather than sax(our xml file is huge)
If your file is huge, JAXB may not be the best way to go. It creates an instance of the entire file in memory (like DOM), it just gives you more specific access methods (e.g., myDoc.getFoo().getBar().getBaz().elementAt(i)). It's easy to work with (esp. since all your classes are generated by JAXB from your schema), but as someone else pointed out, not very flexible in dealing with schema changes. A lot of the decision depends on what it is you're doing with your file.