commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimitri Frederickx" <dimi...@aircrew.be>
Subject [Digester] How to map html-td elements to methods?
Date Fri, 30 Dec 2005 13:41:11 GMT
Hi, I've used commons digester in a few applications, but now I want to do a
mapping that is a little bit tricky.

 

This is an extract of my xml (xhtlm) file:

              <tbody>

                  <tr>

                    <td class="command">open</td>

                    <td class="target">./tests/html/test_open.html</td>

                    <td class="value">&nbsp;</td>

                  </tr>

                  <tr>

                    <td class="command">verifyLocation</td>

                    <td class="target">/tests/html/test_open.html</td>

                    <td class="value">&nbsp;</td>

                  </tr>

              </tbody>

 

This is a part of my java source file:

public class Test {

 

            private String command;

            private String target;

            private String value;

 

            public void setCommand(String functionName) {

                        this.command = functionName;

            }

 

            public void setTarget(String target) {

                        this.target = target;

            }

 

            public void setValue(String value) {

                        this.value = value;

            }

 

}

 

I want that the value of the class-attribute maps to the property (and
method name), and the value of the tag must be the value to pass to this
method.

Is there a way to do this with digester? Does anyone has done something like
this? It would help me a lot, because I'm really stuck at this moment.

 

Regards,

Dimitri


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message