commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eckenfellner Klaus <ecko....@gmail.com>
Subject Re: Reading XML as bean collection using Betwixt
Date Tue, 16 Oct 2007 13:53:22 GMT
Does your collection-bean have adder-functions for the person-beans?

please see example at
http://commons.apache.org/betwixt/guide/examples.html (bottom of page).

Ravindra Wankar wrote:
> 
> 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
> 
> 


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


Mime
View raw message