commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnereson <>
Subject read java.util.Properties from XML with digester
Date Mon, 18 Aug 2008 02:12:49 GMT

Anyone know how to read XML content to java.util.Properties?

Input would be something like


I need to have a Properties entity with  three keys (propertynameA,
propertynameB, propertynameC) and three values (value, value value)

I can figure out as much as

final Digester digester = new Digester();
digester.addObjectCreate("root/properties", Properties.class);
... << what goes here to add keys and set values?

final StringReader reader = new StringReader(xml);
Properties properties = (Properties) digester.parse(reader);

But I am not sure how to grab arbitrary elements under "root/properties" and
assign them as a Property key.

Thank you.
View this message in context:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message