If a class has @XmlElement property, it cannot have @XmlValue property



I get the following error:



If a class has @XmlElement property, it cannot have @XmlValue property


class:



@XmlRootElement(name="priceInclVat")
@XmlAccessorType(XmlAccessType.FIELD)
public class PriceInclVatInfo {

@XmlAttribute
private String currency;
@XmlValue
private String currencyCode;

}


I want the following output:



<currencyCode plaintext="£">GBP</currencyCode>


How can I achieve this?


No comments:

Post a Comment