I'm using Simple framework to deserialize an xml on my android app .
The issue is on a portion of the xml because I can get the objects of the other portions of it .
Here is the part of the xml that I struggle with :
<webtv name="channelname" date="2014-10-31"> <config> <pathVideo extension="mp4">http://vodflash.channelname.com/tv_conn/1/country/</pathVideo> <pathBigImage extension="jpg">http://vodflash.channelname.com/tv_conn/1/country/pic/320x180/</pathBigImage> <pathImage extension="jpg">http://vodflash.channelname.com/tv_conn/1/country/pic/160x90/</pathImage> <pays>GB;IE</pays> </config> Here is my XmlMapper class :
@Root(name="webtv", strict = false) public class XmlModelMapper { public ConfigObject getConfigObjects() { return configObject; } @Element(name="config") public ConfigObject configObject = new ConfigObject(); @ElementList(name = "itemList") private List<Videos> itemList = new ArrayList<Videos>(); public List<Videos> getItemList() { return itemList; } @ElementList(name = "chaineList") private List<Chaine> chaineList = new ArrayList<Chaine>(); public List<Chaine> getChaineList() { return chaineList; } } If I change my mapper class to this :
@Root(name="webtv", strict = false) public class XmlModelMapper { public List<ConfigObject> getConfigObjects() { return configObject; } //change is here using a list not an object @ElementList(name="config") public List<ConfigObject> configObjects = new ArrayList<ConfigObject>(); @ElementList(name = "itemList") private List<Videos> itemList = new ArrayList<Videos>(); public List<Videos> getItemList() { return itemList; } @ElementList(name = "chaineList") private List<Chaine> chaineList = new ArrayList<Chaine>(); public List<Chaine> getChaineList() { return chaineList; } } and the log the size of the List I get 4 which is correct , but how to get each object in a distinct way including the extension (attribute)
Please help me solving this issue .
Thanks