I have a xml structure \"Filter\" that get unmarshalled into in a java class called \"Filter\".
The XML state looks roughly like:
&
How about the annotation of using "@XmlAnyElement"? You can get the instance of org.w3c.dom.Element. The text data should be able to be obtained by operating this instance.
class PropertyType {
private String propertyName;
// private String propertyValue; // comment out
@XmlAnyElement(lax=true)
private List propertyValue; // Adding this
}
exsample of to get text data.
// It is assumed that the child node is one.
org.w3c.dom.Node nd = propertyValue.get(0).getFirstChild();
while(true) {
if (nd.hasChildNodes()) {
nd = nd.getFirstChild();
} else {
System.out.println(nd.getNodeValue()); // this is text data
break;
}
}