I have a application tha need genarate a xml file and send to another app.
Part of DTD of this XML is:
<!ELEMENT Description ( #PCDATA | ShortName )* > <!-- mixed: string and ShortName -->
and Element ShortName was defined:
<!ELEMENT ShortName (#PCDATA)> <!-- string -->
xjc maven plugin are generating Description class as pear the code bellow
`
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = “”, propOrder = {
“value”
})
@XmlRootElement(name = “Description”)
public class Description {
@XmlAttribute(name = "xml:lang", required = true)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String xmlLang;
@XmlValue
protected String value;
`
And ShorName Class
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) @XmlRootElement(name = "ShortName") public class ShortName {
Dont has a mixed attribute with accessors
I need final XML:
<Description xml:lang="pt_BR">a large ball made of leather or plastic and filled with air, used in games of soccer<ShortName>Soccer ball</ShortName> </Description>
Somebody has the same problemas yet?
I´m using java jdk 1.8 and xjc 2.3.1
Tanks
Rafael Santos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.