commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravindra Wankar <rwan...@celoxis.com>
Subject Re: Reading XML as bean collection using Betwixt
Date Tue, 16 Oct 2007 14:06:18 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
No. I'm trying to get all the person objects into an ArrayList.<br>
<br>
Thanks<br>
Ravi.<br>
<br>
Eckenfellner Klaus wrote:
<blockquote cite="mid:4714C252.402@eckenfellner.net" type="cite">
  <pre wrap="">Does your collection-bean have adder-functions for the person-beans?

please see example at
<a class="moz-txt-link-freetext" href="http://commons.apache.org/betwixt/guide/examples.html">http://commons.apache.org/betwixt/guide/examples.html</a>
(bottom of page).

Ravindra Wankar wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">How do I convert an XML to bean collection?

XML:
&lt;persons&gt;
   &lt;person&gt;
       &lt;name&gt;A&lt;/name&gt;
       &lt;age&gt;21&lt;/age&gt;
   &lt;/person&gt;
   &lt;person&gt;
       &lt;name&gt;B&lt;/name&gt;
       &lt;age&gt;25&lt;/age&gt;
   &lt;/person&gt;
   &lt;person&gt;
       &lt;name&gt;C&lt;/name&gt;
       &lt;age&gt;32&lt;/age&gt;
   &lt;/person&gt;
&lt;/persons&gt;

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: <a class="moz-txt-link-abbreviated" href="mailto:user-unsubscribe@commons.apache.org">user-unsubscribe@commons.apache.org</a>
For additional commands, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:user-help@commons.apache.org">user-help@commons.apache.org</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->

---------------------------------------------------------------------
To unsubscribe, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:user-unsubscribe@commons.apache.org">user-unsubscribe@commons.apache.org</a>
For additional commands, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:user-help@commons.apache.org">user-help@commons.apache.org</a>

  </pre>
</blockquote>
<br>
</body>
</html>

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


Mime
View raw message