• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with JAXB Unmarshal xml data

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic