commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravindra Wankar <rwan...@celoxis.com>
Subject Reading XML as bean collection using Betwixt
Date Tue, 16 Oct 2007 11:58:49 GMT

How do I convert an XML to bean collection?

XML:
<persons>
    <person>
        <name>A</name>
        <age>21</age>
    </person>
    <person>
        <name>B</name>
        <age>25</age>
    </person>
    <person>
        <name>C</name>
        <age>32</age>
    </person>
</persons>

Java code:

beanReader.registerBeanClass("persons",  ArrayList.class);
beanReader.registerBeanClass("persons/person",  Person.class);
ArrayList persons = (ArrayList)beanReader.parse(xmlReader);

I get an empty list. I'm using Betwixt 0.8, Digester 1.8, BeanUtils 1.7

Thanks
- Ravi.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message