• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

converting XML String to object model

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic