You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "shailesh.ligade" <sh...@wfinet.com> on 2005/05/05 17:50:24 UTC

digester question

I have a an xml

<tr>
<td colnum="c0">7</td> 
<td colnum="c1">8</td> 
</tr>

I have class called Row and and another Rows

Row class has two mthods (one for column and one for data)
and Rows class has addRow(Row row) method

code is 

digester.addSetProperties("tr/td", "colnum", "column");
digester.addCallMethod("tr/td", "setData", 0); 	

and

digester.addSetNext("tr/td", "addRow");	

What i get in system.out inside addRow is c0 - null so so my data is always
null. Actaully setData() method is getting called, but it is called after
addRow() method.

How to fix this?

SL


�
Attention:
Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.  If you received this in error, please contact the sender and delete the material from any system and destroy any copies.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: digester question

Posted by Simon Kitching <sk...@apache.org>.
On Thu, 2005-05-05 at 11:50 -0400, shailesh.ligade wrote:
> I have a an xml
> 
> <tr>
> <td colnum="c0">7</td> 
> <td colnum="c1">8</td> 
> </tr>
> 
> I have class called Row and and another Rows
> 
> Row class has two mthods (one for column and one for data)
> and Rows class has addRow(Row row) method
> 
> code is 
> 
> digester.addSetProperties("tr/td", "colnum", "column");
> digester.addCallMethod("tr/td", "setData", 0); 	
> 
> and
> 
> digester.addSetNext("tr/td", "addRow");	
> 
> What i get in system.out inside addRow is c0 - null so so my data is always
> null. Actaully setData() method is getting called, but it is called after
> addRow() method.
> 
> How to fix this?

See the FAQ entry titled:
  "How do I get CallMethodRule to fire before SetNextRule?"
at
  http://wiki.apache.org/jakarta-commons/Digester/FAQ

I think this is the information you are looking for..

Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org