Jens Rehpöhler wrote:

> Hello Steven,
>
> I think I didn't described my problem correctly. Parsing the properties of a tag 
>works
> well. But I want to parse the content between some tags. For example:
>
> <database>
>     <user propertie="name">
>         <text>this is the value i want to initialize my class with</text>
>     </user>
> </database>
>
> With the addSetProperties method I can parse the propertie of the user tag, but I
> can't parse the content between the <text> tag.

The rules that are *supposed* to work for this would be:

    digester.addCallMethod("database/user/text", "setText", 1);
    digester.addCallParam("database/user/text", 0);

Translated into English, these rules state that, whenever the specified pattern is
encountered:
* Set up a call to the setText(String text) method of the
  object on the top of the call stack
* Set the zeroth parameter (i.e. the only one) to the
  body content of this element

With other variations of the addCallParam() method, you can take parameter values from
certain attributes of this element as well.

Craig McClanahan


Reply via email to