Two Laptop Bag*
The moose likes XML and Related Technologies and the fly likes converting XML String to object model Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "converting XML String to object model" Watch "converting XML String to object model" New topic
Author

converting XML String to object model

BHAVESH SHA
Greenhorn

Joined: Jun 07, 2007
Posts: 15
Hi ,

In my project the response is coming in the form of xml string and i need to parse and populate my value object i.e java bean with getter and setter methods

for e.g
<application> <applicant>bhavesh</applicant> </application>
application and applicant are java bean

can you please help on this , kindly advice.

Regards
Bhavesh
Vijay K Vivek
Greenhorn

Joined: Oct 11, 2007
Posts: 27
You can use JAXB.

1) Get the xml schema definition for your xml.
2) Use JAXB to get the corresponding element classes for your XSD (xml schema definition )
3) In the code that you have use the unmarshaller and obtain the objects for the XMl elements.
4) Write mappers which will map between your value objects (beans) and the objects of the JAXB generated classes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting XML String to object model
 
Similar Threads
many-to-one create query execution
How would I use Hibernate and criteria to build this query?
convert Xml document to java Object
Class conversion to string
Regarding JAXB 1.3