commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simon <simon.kitch...@chello.at>
Subject Re: Digester1.8 and recursive tag types
Date Fri, 10 Aug 2007 07:53:52 GMT
On Thu, 2007-08-09 at 17:51 -0400, Madisetti, Sumesh wrote:
> Hi,
> 
> I am having trouble parsing recursive tags with digester version 1.8.
> 
> With the digester def below, I am not able to get to any of the inner
> list elements such as person.name=bar3. 
> 
> Any help appreciated.
> 
> Thanks
> Sumesh
> 
> Xml -
> =====
> <list>
> 	<person><name>foo</name></person>
> 	<person><name>bar</name></person>
> 	<list>
> 		<person><name>foo2</name></person>
> 		<person><name>bar2</name></person>
> 		<list>
> 			<person><name>bar3</name></person>
> 		</list>
> 	</list>
> 	<person><name>zap</name></person>
> 	<list></list>
> </list>	
> 
> 
> Digester
> ========
> <digester-rules>
> 	<pattern value="*/list">
> 		<object-create-rule classname="java.util.ArrayList"/>
> 		<pattern value="person">
> 			<object-create-rule classname="TestDig"/>
> 			<set-next-rule methodname="add"/>
> 		</pattern>
> 	</pattern>	
> </digester-rules>

That looks ok to me (though presumably you also have a rule to set the
name attribute for a person which you haven't shown).

I suggest turning on debug-level logging for category
org.apache.commons.digester, which will show what rules are firing and
when.

By "cannot get to person.name=bar3", I presume you mean that no
corresponding java object has been created during the parse. What
objects *do* get created?

Regards,

Simon


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


Mime
View raw message