This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Jersey/JAXB: parsing xml response that has inner tags/elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jersey/JAXB: parsing xml response that has inner tags/elements" Watch "Jersey/JAXB: parsing xml response that has inner tags/elements" New topic
Author

Jersey/JAXB: parsing xml response that has inner tags/elements

Sam Yim
Greenhorn

Joined: Jul 25, 2009
Posts: 17
Building a Jersey Client to retrieve a response in XML.

Sample XML response from a WS:



Using Jersey and JAXB, I am able to get the XML response parsed into a class object (Book)


The problem I am having is with the "inner elements".
The "summary" field of the Book object is null after it's decoded by JAXB.
If I remove the inner element "<p>", I am able to get a value for summary.
I would like JAXB to treat everything within <Summary></Summary> as a string value but how do I let it know to treat inner elements as a string value instead of an xml element?
Sam Yim
Greenhorn

Joined: Jul 25, 2009
Posts: 17
make sure the content is surrounded by <![CDATA[ {content} ]]>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jersey/JAXB: parsing xml response that has inner tags/elements
 
Similar Threads
How to Serialize Maps?
Rendering XML as a response of @RequestMapping
annotations on entity class with spring oxm and jaxb for ArrayList
problem to unmarshal xml file who have element with prefix
Castor Help with unmarshalling