commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <si...@ecnetwork.co.nz>
Subject Re: [digester]: Is there a way to populate bean tags by only one call
Date Fri, 16 May 2003 05:55:15 GMT
On Fri, 2003-05-16 at 17:22, Norbert Krömeke wrote:
> Hi,
> 
> I'm looking for the solution to resolve fallowing problem. The XML input
> looks like this :
> 
> ...
> <parameters>
>    <track1>1234567</track1>
>    <track2>666666666</track2>
>    ....
>    <tag-name>tag-body</tag-name>
> </parameters>
> 
> I want to use only one function to collect all this 'sub-tags' from <parameters>
by
> call of addParam(tag-name, tag-body).
> 
> How can I do it if I use digester-rules.dtd file.

I've not done this myself, so the following is just a guess.

I think you'll first have to use "ExtendedBaseRules" rather than the
default "RulesBase" class as the pattern-matching engine, so that you
can use patterns with trailing wildcards. 

I don't know if the XmlRules stuff allows you to do this from an xml
config file, but it is easy to do in code:
  digester.setRules(new ExtendedBaseRules());

You should then be able to add a CallMethodRule triggered by the pattern
"parameters/*".

Regards,

Simon


Mime
View raw message