I would like to deserialize a XML response from an HTTP request into a list of POJOs. The issue I am encountering is that the XML uses the same name "property" for elements that contain different values.
<nowplaying-info-list>
<nowplaying-info mountName="FGDGFD" timestamp="1559761606" type="track">
<property name="cue_time_duration">
<![CDATA[262000]]>
</property>
<property name="cue_time_start">
<![CDATA[1559761571830]]>
</property>
<property name="cue_title">
<![CDATA[Marine marchande]]>
</property>
<property name="track_album_name">
<![CDATA[Octobre]]>
</property>
<property name="track_artist_name">
<![CDATA[Les Cowboys Fringants]]>
</property>
<property name="track_id">
<![CDATA[8133]]>
</property>
</property>
</nowplaying-info>
...
@JacksonXmlRootElement(localName = "nowplaying-info")
public class ScheduleItem implements Serializable {
@JacksonXmlProperty(localName = "property")
private String song = null;
private String artist = null;
private String cover = null;
private Long datetime = null;
I would like to serialize the property with the name cue_title to the song variable and cue_time_start to datetime.