Hi, I have this class defintion:
@XmlRootElement
public class RssRoot {
private String _version;
private String _xmlns_content;
@XmlAttribute()
public String get_version() {
return _version;
}
@XmlAttribute()
public String get_xmlns_content() {
return _xmlns_content;
}
public void set_version(String version) {
_version = version;
}
public void set_xmlns_content(String xmlnsContent) {
_xmlns_content = xmlnsContent;
}
public RssRoot() {
super();
this._version = "2.0";
this._xmlns_content = "http://purl.org/rss/1.0/modules/content/";
}
}
And it generates this xml:
<rssRoot xmlnsContent="http://purl.org/rss/1.0/modules/content/" version="2.0"/>
However, I need to rename xmlnsContent
to xmlns:content
, and rssRoot
, to rss
. How can I do this?
I tried with @XmlAttribute(name = "xmlns:content")
above the getter and near to the property declaration, but no luck. The thing fails with this message:
Root Exception stack trace: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnno tationExceptions Class has two properties of the same name "_xmlns_content" this problem is related to the following location: RssRoot
What else can I do?