[Simple-support] help ElementList?
Brought to you by:
niallg
|
From: Saul K. <sb...@ny...> - 2011-05-09 17:29:31
|
Please help
How I get "morally excellent" in this xml. I can get entry id, display_form,
and pron.
@Element(name="entry")
public class Entry {
@Attribute
private String id;
@Element(required = false,data=true)
private String display_form;
@Element(required = false,data=true)
private String pron;
@ElementList(inline = true, required = false)
private List<PartOfSpeech> partofspeech;
public String getId() {
return id;
}
public String getDisplay() {
return display_form;
}
public String getPron() {
return pron;
}
public List getPartOfSpeech() {
return partofspeech;
}
}
This does not work
@Root(strict=false)
public class PartOfSpeech {
@Attribute(required = false)
private String pos;
@ElementList(inline = true, required = false, name="defset",data=true)
private List<Defset> defset;
public String getPos(){
return pos;
}
public List getDefset() {
return defset;
}
}
<dictionary query="good" totalresults="9">
<entry source="pdict" id="4086801">
<display_form >
<![CDATA[good]]>
</display_form>
<pron
audiofile="http://static-api.dictionary.com/dictstatic/dictionary/audio/luna
WAV/G02/G0255000.wav">
<![CDATA[[g<i>oo</i>d]]]>
</pron>
<partofspeech pos="adjective">
<defset>
<def charcnt="17" defno="1">
<![CDATA[morally excellent]]>
</def>
<def charcnt="27" defno="2">
<![CDATA[of high or adequate quality]]>
</def>
<def charcnt="12" defno="3">
<![CDATA[well-behaved]]>
</def>
<def charcnt="4" defno="4">
<![CDATA[kind]]>
</def>
<def charcnt="5" defno="5">
<![CDATA[valid]]>
</def>
<def charcnt="9" defno="6">
<![CDATA[favorable]]>
</def>
</defset>
</partofspeech>
<partofspeech pos="noun">
<defset>
<def charcnt="19" defno="7">
<![CDATA[profit or advantage]]>
</def>
<def charcnt="6" defno="8">
<![CDATA[virtue]]>
</def>
<def charcnt="11" defno="9">
<![CDATA[possessions]]>
</def>
</defset>
</partofspeech>
|