Re: [Simple-support] help Š ElementList?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-05-10 02:39:35
|
Where is defset defined? use the @Text annotation.
--- On Mon, 9/5/11, Saul Kessler <sb...@ny...> wrote:
From: Saul Kessler <sb...@ny...>
Subject: [Simple-support] help Š ElementList?
To: sim...@li...
Received: Monday, 9 May, 2011, 10:01 AM
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/lunaWAV/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>
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|