Differentiating two elements of the same name in JAXB based on a parent element

Ronya

New Member
If I have XML like so\[code\]<foo> <baz a="hello">Goodbye</baz></foo><bar> <baz b="something" c="somethingelse"></baz></bar>\[/code\]JAXB won't allow me to have two different classes, say \[code\]package.Baz\[/code\] and \[code\]package.sub.Baz\[/code\] both mapped to the same element via \[code\]@XmlType(name = "baz")\[/code\]. So is it possible to unmarshall the \[code\]baz\[/code\] elements to two different classes based solely on their parents?
 
Back
Top