From: "Luke Shannon" <[EMAIL PROTECTED]>
> public TreeMap digest() throws IOException, SAXException {
> digester = new Digester();
> digester.setValidating(false);
> digester.addObjectCreate("DATA/VERSION", "createTreeMap");
An ObjectCreateRule needs to know the type of object to create, not a method
to call. You need to let Digester create an object and push it on the
stack, and calling createTreeMap won't do that.
> digester.addSetProperties("DATA/VERSION/ITEM", "NAME", "name");
> digester.addCallMethod("DATA/VERSION/ITEM", "addItem", 0);
> return fieldsValues;
> }
I thought...
digester = new Digester();
digester.setValidating(false);
digester.addObjectCreate("DATA/VERSION", "TreeMap.class");
digester.addCallMethod("DATA/VERSION/ITEM", "put", 2);
digester.addCallParam("DATA/VERSION/ITEM", 0, "NAME");
digester.addCallParam("DATA/VERSION/ITEM", 1);
return digester.parse(file);
It should create a TreeMap and then call 'put' with the value of the NAME
attribute and the body of the <ITEM> tag as the name/value pair. Some of
the method params may be switched around, double check the signatures.
HTH,
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]