commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit <amit.hanchinam...@gmail.com>
Subject [Digester] How to get element values from multiple xml documents
Date Mon, 20 Aug 2007 09:49:44 GMT
Hi All,

I am using Digester to parse xml document. My xml document looks as follows

<addresses>
<address id="1">
<street>street 1</street>
<city>city 1</city>
</address>
<address id="2">
<street>street 2</street>
<city>city 2</city>
</address>
</addresses>

I create a javabean class with attributes street and city. Now every time I
parse this file with digester I set the values of these attributes.
The problem is everytime I parse the javabean is set with the last <address>
attributes here street 2 and city 2 and hence the first and consecutive
<address> values are overwritten. How can I make every <address> element
stored or accessible without getting overwritten..?
Any help appreciated.

Cheers
Amit







<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=111787&amp;t=1">Get
Firefox!</a>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message