Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 93717 invoked from network); 29 Jul 2003 01:03:00 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 29 Jul 2003 01:03:00 -0000 Received: (qmail 65574 invoked by uid 1059); 29 Jul 2003 01:02:58 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 29 Jul 2003 01:02:58 -0000 Date: Mon, 28 Jul 2003 18:02:57 -0700 (PDT) From: "Craig R. McClanahan" To: Jakarta Commons Users List Subject: Re: Simple XML filter for Digester In-Reply-To: Message-ID: <20030728180144.S63348@icarus.apache.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Mon, 28 Jul 2003, robert burrell donkin wrote: > Date: Mon, 28 Jul 2003 23:50:17 +0100 > From: robert burrell donkin > Reply-To: Jakarta Commons Users List > To: Jakarta Commons Users List > Subject: Re: Simple XML filter for Digester > > hi Aaran > > i'm afraid that i don't know of an easy way to do this (currently). the > pattern matching rules don't look for attributes and anyway can't be > easily modified dynamically. > > this could probably be done using a filter for the SAX events (but that > might be a little tough since you're new to xml). maybe some kind of > generic filtering could be added to digester (but i'm not sure how easy > this would be). > > any one else have any good ideas about how to solve this one? > > - robert > > On Saturday, July 26, 2003, at 03:49 AM, Aaran Stent wrote: > > > Hello, > > > > I am new to XML, after reading all of the hype I have fond disgester is a > > actually a practicle way of using XML in a "real world environment". I > > have > > setup a digester object to load select/combo boxes for my application. A > > simple XML example follows: > > > > > > > > > > > > > > > > > > This works fine, i can load all of the objects into a LinkedHashMap but I > > want to reuse the combo boxes witout having to clone objects. I would > > like > > to tell the digester to load just one object based on an attribute in a > > tag. > > eg MyComboBoxClass colour = loadCombo("colour"); > > Why can't you just call: MyComboBoxClass colour = (MyColour) linkedHashMap.get("colour"); It seems like a lot of extra effort to reparse the XML every single time. > > I have read the article on the ibm website regarding using lucene > > (http://www-106.ibm.com/developerworks/library/j-lucene) but I did not ant > > to go to the trouble of building idexes on the hard drive. > > > > Thanks, > > > > Aaran > > Craig