Hello Andre,
I've had similar issues and after some time I was able to make my lists
work.
Have a look at the following files from apache bugzilla issue 36831:
http://issues.apache.org/bugzilla/attachment.cgi?id=16539
The bug report is acutally against betwixt + java 5 generics, but the
link above contains working samples without generics. Maybe you can use
these files as a cut-copy-paste template for your problem.
Rgds
Holger
André Nedelcoux wrote:
Hi,
I'm trying to use betwixt in order to load some XML files into Java beans.
The structure I'm trying to load is the following:
<root>
<line>
<entry>some data</entry>
<entry>some data 2</entry>
...
</line>
<line>
<entry>some data 3</entry>
<entry>some data 4</entry>
...
</line>
</root>
I am using the following betwixt mapping (inspired by the tutorial):
<?xml version="1.0" encoding="UTF-8" ?>
<info>
<element name='root'>
<element name='line' property='lines' class='Line'>
<element name='entry' property='entries'/>
<addDefaults/>
</element>
</element>
</info>
The Java classes are the following:
public class Root {
private List lines = new ArrayList();
public List getLines() {
return lines;
}
public void addLine(Line line) {
lines.add(line);
}
}
public class Line {
private List entries = new ArrayList();
public List getEntries() {
return entries;
}
public void addEntry(String entry) {
entries.add(entry);
}
}
I feel my case is quite basic but I can't make it work: it never reaches the
"entry" level in the xml file.
Am I using betwixt in a wrong way? Is there any specificity that makes
betwixt unusable in my case?
Thanks for your help.
André
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]