The XML content that returns from server:
<root>
<option value="ROW VALUE1">ROW CONTENT1</option>
<option value="ROW VALUE2">ROW CONTENT2</option>
</root>
My representation for option
object:
public class Option {
@Element(name = "option")
private String option;
@Attribute(required = false)
private String value;
}
My representation for Response
object:
@Root(name = "root")
public class GetOptionsResponse
{
@ElementList(entry = "option", inline = true)
private ArrayList<Option> mOptionList;
}
But anytime I tried to run the code and parse it, I got:
java.lang.RuntimeException: org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Element(data=false, name=option, required=true, type=void) on field 'option' private java.lang.String com.packagename.models.Option.option for class com.packagename.models.Option at line 1
What am I doing wrong?