Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 89497 invoked from network); 1 Feb 2005 20:19:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Feb 2005 20:19:36 -0000 Received: (qmail 49109 invoked by uid 500); 1 Feb 2005 20:19:25 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 49057 invoked by uid 500); 1 Feb 2005 20:19:25 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 49003 invoked by uid 99); 1 Feb 2005 20:19:25 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from bella.lunarpages.com (HELO bella.lunarpages.com) (216.193.194.185) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 12:19:23 -0800 Received: from [209.147.173.40] (helo=A2000018) by bella.lunarpages.com with esmtpa (Exim 4.43) id 1Cw4Ub-0006E3-Vj for commons-user@jakarta.apache.org; Tue, 01 Feb 2005 12:19:22 -0800 Message-ID: <032401c5089b$50ded0e0$28ad93d1@irm.local> From: "Wendy Smoak" To: "Jakarta Commons Users List" References: <032d01c507ee$eb20e6a0$7703d00a@hypermedia.com> <38e8470105013116182138a728@mail.gmail.com> <039d01c50876$f1269d50$7703d00a@hypermedia.com> <03f801c50888$a8244190$7703d00a@hypermedia.com> <029a01c50894$bac6a610$28ad93d1@irm.local> <042201c50898$b84814b0$7703d00a@hypermedia.com> Subject: Re: Need a little help Date: Tue, 1 Feb 2005 13:19:16 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bella.lunarpages.com X-AntiAbuse: Original Domain - jakarta.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - wendysmoak.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N From: "Luke Shannon" > 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 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: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org