I need to unmarshal a tricky xml stream and I need some help. Here is an example of what I'm running into:
A sample POJO for this xml would look like this:
The problem is how do I capture the <name> element? If I set it as an @XmlAttribute name, it comes up null. If I create a
java class called Name and include it in Pet as a @XmlElement, it does get instantiated so I guess that's on the right track, but I still don't know how to capture the value 'Fido'. I tried creating a constructor that accepts a
String value, but that didn't work. I also tried creating a @XmlAttribute variable in the Name class called name, but that didn't work either. Please help.