Two utterly different JAXB annotated classes, same @XmlElement name. Possible?

setdeterlei

New Member
We have an existing document tree. We want to wrap some of the elements inside this tree up within a element.Depending on where in the tree we are, the element will hold very different content.So I have a DocumentPromptLanguage class and a DocumentRouterLanguage class. They have different parents and different children but it makes sense that in XML they are both called \[code\]<language>\[/code\].Is this possible without adapters or must the XML representation disambiguate by element name?Sample:\[code\]<?xml version="1.0" encoding="utf-8"?><doc> <info> <language> <iso639>en</iso639> <value>This is a sample document</value> </language> <language> <iso639>es</iso639> <value>Se trata de un documento de muestra</value> </language> </info> <someElement> <route> <language> <iso639>en</iso639> <possibleValues>Yes|No|Maybe</possibleValues> <prefix>For</prefix> </language> <language> <iso639>es</iso639> <possibleValues>s
 
Back
Top