commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sven Schliesing" <s...@schliesing.de>
Subject [digester] Retrieving two child-nodes
Date Wed, 24 May 2006 16:39:03 GMT
Hi,

I'm having a xml-file like this:
------
<users>
  <user nick="John" pwHash="bla" isAdmin="true"/>
  <user nick="Mary" pwHash="bla" isAdmin="true"/>
</users>

parsing it with this snippet:
------
Digester digester = new Digester();
digester.setValidating(false);
digester.addObjectCreate("users/user", IrcUser.class);
digester.addSetProperties("users/user");
try {
	IrcUser ircUser = (IrcUser) digester.parse(configFile);
	System.out.println(ircUser);
} catch (IOException e) {
	throw new ModuleException(e);
} catch (SAXException e) {
	throw new ModuleException(e);
}
------

The output I get is:
------
Mary
------

How do I get the Object for "John", too?

Thanks in advance!

Sven


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


Mime
View raw message