Re: [Simple-support] Error with ElementList
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-05-22 11:53:26
|
Declare list as @ElementList(inline=true, entry="Rule") it will work then
--- On Tue, 22/5/12, Thomas Steingruber <tho...@gm...> wrote:
From: Thomas Steingruber <tho...@gm...>
Subject: [Simple-support] Error with ElementList
To: sim...@li...
Received: Tuesday, 22 May, 2012, 1:55 AM
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
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|