aspose file tools*
The moose likes XML and Related Technologies and the fly likes JAXB now or wait? 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 "JAXB now or wait?" Watch "JAXB now or wait?" New topic
Author

JAXB now or wait?

Mark Stein
Ranch Hand

Joined: May 20, 2002
Posts: 75
I've been reading up on JAXB, and it definitely looks more appealing than JDOM. My only concern is that Sun says the "next update will not be API-level compatible with the current early access release".
Does it pay for me to invest time getting familar with it now, or should I wait until after the next release (Q4 2002). How much change of an API change is expected?
Mark Stein
SCJP2
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
i have'nt worked with JAXB / JDOM but i understand what they are.
W'dnt we be using JAXB only when we want a java representation of an XML document that adheres to a DTD?
So JAXB is applicable only in cases of valid and wellformed XML documents?
My question:
Are JDOM and JAXB interchangeable?
JDOM i guess is a generic representation (tree or any datastructure) of any XML file
whereas JAXB results in a custom java object.
As long as i know how the input XML file is going to look like , i can probably use JAXB.
Can i safely conclude that..
1. If I'm expecting an xml document which is associated with a schema / DTD
2. and I need to process the whole document
I w'd go for JAXB and not for DOM/ JDOM?




Originally posted by Mark Stein:
I've been reading up on JAXB, and it definitely looks more appealing than JDOM.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
XML is 'structured data'. So if you want to manipulate the DATA and the STRUCTURE use DOM, JDOM or XSLT. If you just want to change the DATA but NOT the STRUCTURE than consider to use XML Data Binding: JAXB from Sun, - it creates the Java Data Objects out of DTDs - or the much major Castor XML - it create the Java Data Objects out of XML Schema (http://castor.exolab.org/xml-framework.html).
Using Data Binding its worth considering that changes to the STRUCTURE requires a rebinding, that means you need to update the Java Data Objects. Anyways, manipulation the DATA is much easier with Data Binding than with DOM or JDOM.
Regards
Berny
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
I agree to what has been said so far. JAXB is not a replacement for JDOM. They serve totally different purposes and hence are not mutually exclusive.
There has been a lot of things going on in the databinding arena. JAXB is now a part of the acclaimed JAXPack in JDK1.4. There are other implemementations out there for XML to JavaBean and vice-versa conversion.
IMO since the standards are still evolving, I donot feel comfortable in using JAXB in anything critical. Remember DTD and Schema spec itself have undergone significant changes since they were born and all databinding implementations must adopt to the latest spec.
Until the standards mature, I may not consider using JAXB. Just my opinion..


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXB now or wait?