commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Valerio Schiavoni" <valerio.schiav...@gmail.com>
Subject [Digester] parameter value from a parent node attribute
Date Fri, 21 Apr 2006 13:23:25 GMT
Hello,
i have the following xml:
<root>
<element id="A">
   <subelement id="B"/>
</element>
</root>

whenever I match path element/subelement, i need to invoke a 2-parameters
method  defined on the object on the stack
,call it twoParamMethod(String idElement,String idSubElement).

i was able to code up to this code:

digester.addCallMethod("root/element/subelement", "twoParamMethod", 2);
//HOW DO I GET THE VALUE FOR THE FIRST PARAMETER ?
 digester.addCallParam("root/element/subelement", 1, "id"); //value for the
second parameter

i need to this to fill in a map (stored in the root object) key="element
id", values="list of id-s of subelements";

thanks,
valerio

--
http://valerioschiavoni.blogspot.com
http://jroller.com/page/vschiavoni

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