commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Antonio Pérez Testa <japte...@indra.es>
Subject Re: Strange behaviour with xmlrules
Date Wed, 18 Jun 2003 14:38:14 GMT
Incorrect,
with my rule, each 'baz' will fire a call to the method 'setContent' in 
the object on top of  the stack, i.e. the same MyBaz object.
With my rule new MyBaz object is created by the token 'bar' not by 
'baz', that's why there has to be only one 'baz' or the method should be 
called 'addContent' instead.

Horn, Lutz wrote:

>Hi,
>
>* José Antonio Pérez Testa [mailto:japtesta@indra.es]
>  
>
>>I think that the problem is in the xml structure and the fact 
>>that the 
>>same token 'baz' creates the object and calls the method.
>>I'm doing a very similar processing whith the following rules:
>>
>><digester-rules>
>>  <object-create-rule pattern="foo" classname="MyFoo"/>
>>
>>  <pattern value="foo/bar">
>>    <object-create-rule classname="MyBaz"/>
>>    <call-method-rule pattern="baz" methodname="setContent" 
>>paramcount="0"/>
>>    <set-next-method methodname="addBaz"/>
>>  </pattern>
>></digester-rules>
>>    
>>
>
>This is what I tried: <call-method-rule> first, <set-next-method>
>second. As I wrote, this calls addBaz() of the MyFoo instance before
>setContent() of the MyBaz instance is called. So this exactly is my
>problem.
>
>  
>
>>If there is only one 'baz' in each 'bar' this should work!
>>    
>>
>
>But even if there were more than one 'baz' in each 'bar' a new
>MyBaz schould be created, filled, and added to MyFoo for each of them
>using your rule. Correct?
>
>Regards
>Lutz
>
>---------------------------------------------------------------------
>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