Hello,
I want to use digester to solve the following task:
test.xml
<?xml version='1.0' encoding='utf-8'?>
<root>
<a>content</a>
<b>
<a>deeper content</a>
</b>
<a>another content</a>
</root>
The code:
Digester d = new Digester();
d.addObjectCreate("root", Root.class);
//match all "a"
d.addSetRoot("*/a", "addA", "java.lang.String");
Root root = (Root) d.parse(new File("test.xml"));
and:
public class Root {
private String aA;
public void addA(Object a) {
System.out.println(a);
}
}
The system.out tells me, the passed object is an Root-Object. But I need
to have the content.
Where is my mistake. What can I do?
Thanks for any advice!
Reidar
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]