I'm using maven-jaxb-plugin and maven-jaxb2-plugin to compile a xsd file that has two elements with same name, but the code compiles without throws an error. The generated class don't have the co-related properties. See the generated class:
...
* <element name="elementName" type="{http://namespace}typeElementName"/>
* <element name="elementName" type="{http://namespace}typeElementName"/>
public class TypeNameType {
@XmlElementRefs({
@XmlElementRef(name = "elementName", namespace = "http://namespace", type = JAXBElement.class)
})
protected List<JAXBElement<? extends Serializable>> content;
public List<JAXBElement<? extends Serializable>> getContent() {
if (content == null) {
content = new ArrayList<JAXBElement<? extends Serializable>>();
}
return this.content;
}
}
and XSD:
<schema elementFormDefault="qualified"
targetNamespace="http://namespace"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://namespace">
<complexType name="typeNameType">
<sequence>
<element minOccurs="1" maxOccurs="1" name="elementName" type="string" />
<element minOccurs="1" maxOccurs="1" name="elementName" type="string" />
</sequence>
</complexType>
</schema>
Can anybody help me with this issue?
Tks!
Marcelo