I'm trying to use the simpleframework converter to convert this XML :
<?xml version="1.0" encoding="UTF-8" ?>
<dvds generator="$Id: dvd.tpl 855 2008-08-04 15:53:24Z glapierre $"></dvds>
To those classes :
@Root
public class SearchResult {
@Attribute(name = "generator")
private String generator;
@ElementList(entry = "dvd", inline = true, required = false, empty = true)
private List<DVDResult> dvds;
public SearchResult() {}
public List<DVDResult> getDVDs() {
return dvds;
}
public String getGenerator() {
return generator;
}
}
@Root
public class DVDResult {
// Some @Element with getters
}
When the list is not empty there is no problem but in this particular case I get a org.simpleframework.xml.stream.NodeException: Document has no root element
and I really don't know why.
I thought that it was on my @ElementList
so I had entry
and empty
but no changes. I also removed name
from @Root
s.
Does somebody have an answer to that?