[Simple-support] Error with ElementList
Brought to you by:
niallg
|
From: Thomas S. <tho...@gm...> - 2012-05-22 08:56:04
|
Dear all,
I'm new to Simple and I'm trying to read an XML file but I have a problem
with the ElementList.
First of all the XML structure:
<Policy>
<Target>
</Target>
<Rule Effect="Permit" RuleId="#loginPreferences">
</Rule>
<Rule Effect="Permit" RuleId="#emailPreferences">
<Rule>
<Policy>
This is the general structure and obviously Target and Rule contains more
nodes, but I think are not important for this question.
To read the file I have created the class Policy in this way:
@Root
public class Policy {
@Element
private Target Target;
@ElementList
private List<Rule> Rule;
public Target getTarget(){
return Target;
}
public List<Rule> getRules(){
return Rule;
}
}
but when I start to read the XML file I will get this error:
org.simpleframework.xml.core.PersistenceException: Element 'Rule' declared
twice at line 90
Why do I get this error? Can anyone help me solving it?
Thanks
Thomas
|