File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Need help with JAXB Unmarshal xml data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need help with JAXB Unmarshal xml data" Watch "Need help with JAXB Unmarshal xml data" New topic
Author

Need help with JAXB Unmarshal xml data

laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
This is a real-world example where I have an xml document where there is an element <XML_ELEMENT> that I wish I could ignore and just go straight to <PEOPLE> and <PERSON>. Most examples I see don't have this extra wrapper. I don't know if there is a way in my Persons class through annotations to target <PERSONS> without being blocked by <XML_ELEMENT> below. This has me so frustrated because I know there is probably an easy way to do this but I don't know what to search for.... please help.









Many Thanks
laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
Oh my goodness I found it....@XmlElementWrapper is what I needed. I knew it was an annotation that I needed.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need help with JAXB Unmarshal xml data