If you aren't currently using or willing to start using XMLSchema to define an XSD for your documents, then you can ignore JAXB. Nothing wrong with JAXB, just that it is intended to fit into the XMLSchema tools space, not the DTD tools space.
Originally posted by Silvio Esser: If I need to create a XML document, I can use JAXP(DOM) or JAXB. But which way is the best?
That depends entirely on where the data for the XML document comes from, and what you plan to do with the XML document.
If you have a Java object and you want to convert it into XML, and subsequently convert back into the same object, then use JAXB. If you have data in a database (for example) and you want to make it into XML, then use one of the JAXP technologies. As usual in the computing business there is no such thing as "best". Spend some time learning about the various XML technologies and you will not find it necessary to ask questions like this one. Specific questions are much easier to answer.
Joined: Nov 05, 2005
I may call it "better" instead of "best".
Thanks for the inputs. I agree with you that there are just too many frameworks or tools out there that do a little helps, but more confusions. I know BEA has xBean does the same thing as JAXB. [ January 26, 2006: Message edited by: Silvio Esser ]