Very easy to solve issue with SimpleXML. What i'm doing wrong?

拟墨画扇 提交于 2019-12-03 00:20:07

You must put required=false on the ArrayList of areas, some of the Pages of the XML doesn't have Areas

    @Root
public class Page {
    @Attribute
    String src;
    @Attribute
    String id;
    @Attribute
    String thumbnail;
    @ElementList (required=false)
    public ArrayList<Area> areas;
}

That errors appear when I had errors in XML file (like unended tag). For someone who have the same problem and came to this post.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!