commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krithinarayanan <>
Subject Digester - extracting child node as String
Date Wed, 28 Jan 2009 06:25:34 GMT
I am using commons-digester-1.7.jar.
I have the following xml.  My  requirement is during parse, I want to 
extract <course> node as a String, and do no parsing of the course node, 
but unable to do so

Please help, Please do correct me, if in case rules should be changed
Just to let you know, googled for a solution, but unable to find 


            <elective> java </elective>

*I am having the following beans*

public class Student

     public Student (){}
     private  String name;
     private Course course;

    public void setName(String name) 
   = name;

    public String getName()
         return name;
    public void addCourse(Course course)
          this.course = course;
    public Course getCourse()
           return course;

public Course
     String  s;
      public void setS(String s)
            this.s = s;
       public String getS()
              return s;


            digester.addObjectCreate("student", Student.class );
            digester.addObjectCreate("student/course", Course.class );

            digester.addBeanPropertySetter("student/name", "name");
            digester.addBeanPropertySetter("student/course", "s");
            digester.addSetNext("student/course", "addCourse");    

Thanks & Regards
Krithinarayanan G

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message