hi
I started learning google data api.
I have one question
What will be the best way of parsing xml google data xml ?
1 > Should I go with manually parsing xml ?
Or
2 > XML to java object mapping technique ?
I am thinking about going with 2 way, As it will require writing less code from my side.
But I don’t know how slow it will be in comparison to 1 way.
How slow is xml to java mapping technique ?
Is there any other better way to parse gdata xml ?
The answer to this question depends on what you are comparing the xml to Java mapping technique to. Many object-to-XML solutions have been around for quite a while and have learned a number of tricks to do this conversion.
Note: I’m the EclipseLink JAXB (MOXy) lead, and a member of the JAXB (JSR-222) expert group.
I’m not that familiar with the Google Data API, but after a quick google, it appears to be related to Atom which can easily be handled by any of the JAXB implementations:
For an Atom example see:
With JAXB you can also start with your own object model and add annotations to apply the XML mapping:
MOXy also contains an XPath mapping extension that makes mapping your object model even easier: