-
xml to java object (3 messages)
- Posted by: adi adi
- Posted on: October 01 2009 12:53 EDT
hi all, is there a way reading/creating java object from xml without knowing its structure beforehand? I mean everytime a new xml is needed... tnxThreaded Messages (3)
- Re: xml to java object by Sergei Batiuk on October 01 2009 17:12 EDT
- use xstream by Robert Hume on October 02 2009 10:24 EDT
- Re: xml to java object by chetan kokil on October 08 2009 04:35 EDT
-
Re: xml to java object[ Go to top ]
- Posted by: Sergei Batiuk
- Posted on: October 01 2009 17:12 EDT
- in response to adi adi
You can use standard Java libraries to dynamically parse/construct XML. You can easily create a new XML dynamically using DOM or JDOM. You can use SAX, DOM, JDOM or StAX to process XML. You can use Lists and Maps to dynamically construct a Java representation of a parsed XML to be used in your code. Of course, these statements are pretty general, but your requirements are not too specific as well. Please give more specific requirements for a more specific advice. Java Development on Demand. http://www.hitech.com.ua/en/ -
use xstream[ Go to top ]
- Posted by: Robert Hume
- Posted on: October 02 2009 10:24 EDT
- in response to adi adi
I've found XStream to be very useful, it does the Object to XML and XML to Object for you. http://xstream.codehaus.org/ Two minute tutorial here: http://xstream.codehaus.org/tutorial.html -
Re: xml to java object[ Go to top ]
- Posted by: chetan kokil
- Posted on: October 08 2009 04:35 EDT
- in response to adi adi
Cant u use , JAXB or JAXP for the xml processing, I think this will help u to acheive u r purpose.