commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingfai Ma" <ming...@hongkong.com>
Subject RE: Digester question
Date Thu, 13 Feb 2003 08:59:42 GMT
I hope the following can help. In digester, you add rules to handle any
element. for example, you can use two rules:
          digester.addRule( "phonebook/entry", new ObjectCreationRule(
"package.name.Entry" ) );
          digester.addRule( "phonebook/entry/number", new
BeanPropertySetterRule("numberField") );
the first rule to handle the 'entry' element and the 2nd for 'number'. The
rules are example and you can use any rules.

I'm not very good in Digester. Please ask others if the above cannot help.

regards,
mingfai



> -----Original Message-----
> From: Peng Tuck Kwok [mailto:pengtuck@makmal.net]
> Sent: Thursday, February 13, 2003 2:59 PM
> To: commons-user@jakarta.apache.org
> Subject: Digester question
>
>
> Is it possible to handle duplicate elements in commons digester using
> the following example ?
>
>
> <phonebook>
> 	<entry>
> 	 <owner>Owner</owner>
> 	 <number>Number</number>
> 	 [ and many other numbers to follow..]
> 	 </entry>
> </phonebook>
>
> I can handle many <entry> elements but can't quite yet grasp how to do
> the multiple number elements. Does anyone have any idea how to do this ?
>
>
> ---------------------------------------------------------------------
> 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