On Wed, 2005-12-28 at 10:59 -0500, Russell Simpkins wrote:
> did you try:
>
> digester.addBeanPropertySetter("students/student/property[name='name']/@value");
> digester.addBeanPropertySetter("students/student/property[name='course']/@value");
> digester.addBeanPropertySetter("students/student/property[name='age']/@value");
>
> which is the XPath way to grab those property values
Unfortunately digester doesn't support xpath. There's no functionality
to do [...] or @... expressions, just pretty simple operations to match
or not match the "path to the current node".
However the syntax
<student>
<property name="prop1" value="val1"/>
<property name="prop2" value="val2"/>
</student>
can be processed using the SetPropertyRule.
Coinfiguring the Digester instance using:
digester.addSetProperty("student/property", "name", "value");
will cause these calls:
ObjOnTopOfStack.setProp1("val1");
ObjOnTopOfStack.setProp2("val2");
which I believe is what is wanted.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]