|
|
Re: MOXy 2.2.0 and CDATA [message #660302 is a reply to message #659736] |
Thu, 17 March 2011 17:56 |
|
Hi Kasper,
I noticed a couple of items with your metadata. First off you want to put all your annotations on either the field or the property:
@XmlElement(name="metadata.text")
@XmlCDATA
private String metadataText;
or
@XmlElement(name="metadata.text")
@XmlCDATA
public String getMetadatatext() {
return metadataText;
}
Second the element name you are actually mapping to is "param" and not "metadata.text":
@XmlElement(name="param")
@XmlCDATA
public String getMetadatatext() {
return metadataText;
}
If you want the mapping to be conditional on the "metadata.text" attribute you will be interested in an extension (https://bugs.eclipse.org/339596
) we're working on to our XPath based mapping. It will let you do the following:
@XmlPath(name="param[name='metadata.text']/text()")
@XmlCDATA
public String getMetadatatext() {
return metadataText;
}
-Blaise
|
|
|
|
Powered by
FUDForum. Page generated in 0.02976 seconds