Click here to Skip to main content
15,907,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,

Right now I'm facing problems while I parse attributes of an xml using digester. I'm able to parse node text content but I'm not able to parse attribute value.


here is My code.

Java
Digester digester = new Digester();
  
digester.addObjectCreate("root/child",Child.class);
digester.addSetProperties("root/child","name","name");

digester.parse(new File("c:\\test.xml");


Thanks in advance.
Posted
Updated 2-Nov-11 3:49am
v3
Comments
Nagy Vilmos 2-Nov-11 9:50am    
Formatted code and added capitalisation.

1 solution

Have a read of this[^].

It should help you in answerign your question. Unfortunately, you haven't really provided enouh information to know exactly where you are going wring. Adding the code at the point oyu try read the content of the XML would help.
 
Share this answer
 
Comments
Balaji_Reddy 3-Nov-11 0:58am    
Thanks for ur previous post.

I wan to store attribute value in a Bean.
here my xml goes


<root>

<name>xxxx


<name>yyy



Here I wan to read my attribute value using digester.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900