The obvious answer is DOM (best represented by JAXP), which represents your XML document using a generic Java API. If you want your objects to closely represent the XML document, what about the Java API for XML binding (JAXB)? It compiles an XML schema into Java classes which will form a direct representation of your XML document. - Peter
Joined: Sep 06, 2001
I have an xml file and I want to create a java object. Do you have a small example of JAXB which you can send me. Any small example will do?
You can also use JDOM. I believe it is in review by the java community process. At any rate, it makes it very easy to manipulate an xml file within a java program as a Document object. Something like this
"the Java API for XML binding (JAXB)? It compiles an XML schema into Java classes which will form a direct representation of your XML document." Thanks Peter. Now, I don't need to write classes to map XML to java obj.