i'm deserializing a Xml file which is :
<?xml version="1.0" encoding="utf-8"?>
<UserList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserLists>
<user>
<username>Salesman1</username>
<password>123</password>
<salesmanId>4</salesmanId>
</user>
</UserLists>
</UserList>
with this line that throws me the Exception :
org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.ElementList(data=false, empty=true, entry=user, inline=true, name=, required=true, type=void) on field 'user' public java.util.List azdad.pos.android.UserList.user for class azdad.pos.android.UserList at line 2
my entity class is :
import java.util.List;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Path;
import org.simpleframework.xml.Root;
@Root(name="UserList",strict=false)
public class UserList{
@ElementList(entry="user", inline=true)
public List<UserInfo> user;
public List<UserInfo> getUsrs(){
return user;
}
}
I've used
strict
to ignore the Tag According to this link :
How to ignore unused XML elements while deserializing a document?
but it doesn't work , does anybody know how can i ignore tag for deserializng