commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Valerio Schiavoni" <valerio.schiav...@gmail.com>
Subject Re: [Digester] parameter value from a parent node attribute
Date Wed, 26 Apr 2006 14:00:56 GMT
Hello Simon

On 4/26/06, Simon Kitching <skitching@apache.org> wrote:
>
>   <committer>
>     <element id="xx">
>       <children>
>         <subelement refid="y1"/>
>         <subelement refid="y2"/>


you got it !

A ConfigurationDescriptor is created at <committer> only. This class has
> methods
>   addElementType(String id);
>   addChildForType(String id, String refId)


correct again.

It would be far easier if you had an object that represented an element
> with a particular id (ie something was created for each <element> tag)


even if it is 'easier', I don't agree completely: creating a full Object
only to store the the value of a String sounds a bit weird.

If you just can't or won't alter your model, you could possibly use a
> digester "named stack" to keep track of the element id:


actually, i was investigating into this solution, and after you showed me
the way, I was able to get it correctly working!

Regardless, if you do alter any digester stack (and esp. the main one),
> you should only ever push things in begin(), and only ever pop them in
> end().


i will  tattoo this on my  leg :)

--
http://valerioschiavoni.blogspot.com
http://jroller.com/page/vschiavoni

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message