If there is a XML file like this:
<List>
<ListItem>
<Element1>foo</Element1>
</ListItem>
<ListItem>
<Element2>another foo</Element2>
</ListItem>
<ListItem>
<Element3>foo foo</Element3>
</ListItem>
<ListItem>
<Element4>foooo</Element4>
</ListItem>
<ListItem>
<Element5>foo five</Element5>
</ListItem>
</List>
How can I read elements, which names are always different? The <ListItem>
tag is always the same, but the elements always have different names..
I'm stuck at this point:
@Root(name = "ListItem")
public class ListItem
{
@Element(name = ?????)
String Element;
}
And in the end I want to use it like this:
...
@ElementList(name = "List")
List<ListItem> Items;
...
Regards