Re: Digester: How to read the body of a tag?

2001-02-10 Thread Jens Rehpöhler
Hello Craig, as always you gave the conclusive hint. Perhaps you should add an example of the usage of this methods to the documentation. It would make things much more clearer. thanks, Jens "Craig R. McClanahan" wrote: Jens Rehphler wrote: Hello Steven, I think I didn't described

Re: Digester: How to read the body of a tag?

2001-02-10 Thread Craig R. McClanahan
Jens Rehphler wrote: Hello Craig, as always you gave the conclusive hint. Perhaps you should add an example of the usage of this methods to the documentation. It would make things much more clearer. Good idea. I'm adding an example of using this technique to the Developer's Guide page

Digester: How to read the body of a tag?

2001-02-09 Thread Jens Rehpöhler
Hi all, I'm trying to read the body content of a xml tag with the Digester class. By using the standard methods from the class I only get an empty String. Here's the example code (i justed played around with the user database from the struts example): Digester Code: // this works fine

Re: Digester: How to read the body of a tag?

2001-02-09 Thread Steven D. Wilkinson
It also has to do with your class structure and your xml. I haven't tested this, but try this public class User { private Tagwithbody twb = null; public void setTagwithbody(Tagwithbody theClass) { twb = theClass; } public Tagwithbody getTagwithbody() { return twb; } } public class

Re: Digester: How to read the body of a tag?

2001-02-09 Thread Jens Rehpöhler
Hello Steven, I think I didn't described my problem correctly. Parsing the properties of a tag works well. But I want to parse the content between some tags. For example: database user propertie="name" textthis is the value i want to initialize my class with/text /user /database

Re: Digester: How to read the body of a tag?

2001-02-09 Thread Craig R. McClanahan
Jens Rehphler wrote: Hello Steven, I think I didn't described my problem correctly. Parsing the properties of a tag works well. But I want to parse the content between some tags. For example: database user propertie="name" textthis is the value i want to initialize my class

Re: Digester: How to read the body of a tag?

2001-02-09 Thread martin . cooper
I've been using a slightly simpler method than Craig's to get the body content. I use this: digester.addCallMethod("database/user/text", "setText", 0); I got the idea for this from the JavaDoc comment for addCallMethod, which says that specifying zero for the parameter count means "a single

Re: Digester: How to read the body of a tag?

2001-02-09 Thread Craig R. McClanahan
[EMAIL PROTECTED] wrote: I've been using a slightly simpler method than Craig's to get the body content. I use this: digester.addCallMethod("database/user/text", "setText", 0); I got the idea for this from the JavaDoc comment for addCallMethod, which says that specifying zero for the