commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [Digester] Parse into HashMap using Commons Digester
Date Tue, 30 Dec 2008 19:43:36 GMT
On Tue, Dec 30, 2008 at 11:07 AM, Sudhi Shetty <reachtiger@gmail.com> wrote:
> I need to parse a XML file having the following format(Not posting the
> actual XML due to confidentiality reasons but repesenting the problem
> in a sample format) :
>
> <movielibraries>
> <library name="Libra">
>  <movie name="XYZ">
>       <releasedate date="ABC"/>
>       <director name="SDR"/>
>   </movie>
> </library>
> <library>
> ......
> </library>
> </movielibraries>
>
> I want to parse this into a HashMap where in the 'key' is the library
> name and value is 'List' of Movie instances for that library.
> class Movie {
>   String name;
>   Date releaseDate;
>   String director
> }
> Is it possible to achieve this using Digester?
<snip/>

Yes. Please see the developer guide [1] and examples [2] for details,
and let us know if you have specific questions.

-Rahul

[1] http://commons.apache.org/digester/commons-digester-1.8/docs/api/org/apache/commons/digester/package-summary.html#package_description
[2] http://svn.apache.org/repos/asf/commons/proper/digester/trunk/src/examples/

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


Mime
View raw message