Can I ask regarding the
java jaxb, if we have nested child elements in the xml document, how do we unmarshal it using java objects?
I am able to unmarshal all the single elements.
However for the nested child, I have difficulty unmarshalling the phone-type and phone-number in the PhoneNumber.class.
Attached are my files and the main method below to call the unmarshalling of xml.
<person>
<id>123</id>
<first-name>john</first-name>
<last-name>tan</last-name>
<phone-numbers total="1">
<phone-number>
<phone-type>mobile</phone-type>
<phone-number>12345678</phone-number>
</phone-number>
</phone-numbers>
<email-address>
asd@gmail.com</email-address>
</person>
Thank you!