commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham, Ryan - WMD" <>
Subject [digester] nested element detection
Date Tue, 13 Dec 2005 23:00:48 GMT
Hi All,

I'm trying handle the following bit of xml but I'm having some trouble
doing so:

   <logitem timestamp="Fri Dec 09 14:16:18 MST 2005">
      <error from="...">
   <logitem timestamp="Fri Dec 09 14:18:55 MST 2005">
      <warning from="...">
   <logitem timestamp="Fri Dec 09 14:30:05 MST 2005">
      <info from="...">

I want to create an object for each logitem, set the timestamp, set the
type based on the next element (error, warning or info) and then get the
message text. I've tried to do something like this without much success:
digester.addObjectCreate("log/logitem", LogItem.class);
digester.addSetProperties("log/logitem", "timestamp", "timestamp");

//here is where I get stuck...
digester.addSetProperties("log/logitem/*", "type", "type");
digester.addSetNext("log/logitem ", "addLogItem");

Any help would be greatly appreciated.


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

View raw message