Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 36160 invoked from network); 30 Jun 2005 02:52:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Jun 2005 02:52:59 -0000 Received: (qmail 47616 invoked by uid 500); 30 Jun 2005 02:52:49 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 47604 invoked by uid 500); 30 Jun 2005 02:52:49 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 47591 invoked by uid 99); 30 Jun 2005 02:52:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2005 19:52:49 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [210.86.15.187] (HELO mta205-rme.xtra.co.nz) (210.86.15.187) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2005 19:52:52 -0700 Received: from pop2-rme.xtra.co.nz ([210.86.15.240]) by mta205-rme.xtra.co.nz with ESMTP id <20050630025246.HBNZ11967.mta205-rme.xtra.co.nz@pop2-rme.xtra.co.nz>; Thu, 30 Jun 2005 14:52:46 +1200 Received: from [10.1.1.9] ([222.153.39.203]) by pop2-rme.xtra.co.nz with ESMTP id <20050630025245.UMRP16943.pop2-rme.xtra.co.nz@[10.1.1.9]>; Thu, 30 Jun 2005 14:52:46 +1200 Subject: Re: [digester] multiple parent child relationships using xmlrules From: Simon Kitching Reply-To: skitching@apache.org To: Richard Wood Cc: Jakarta Commons Users List In-Reply-To: <1120099422.3783.19.camel@localhost.localdomain> References: <001801c57c00$cea5e530$4f1b4854@floyd> <1120039983.3751.97.camel@localhost.localdomain> <002a01c57cd3$c66cf420$4f1b4854@floyd> <1120099422.3783.19.camel@localhost.localdomain> Content-Type: text/plain Date: Thu, 30 Jun 2005 14:53:55 +1200 Message-Id: <1120100035.3783.26.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Thu, 2005-06-30 at 14:43 +1200, Simon Kitching wrote: > > > > > Note however that digester rules typically operate on the top object on > > > the stack. So you may find that pushing more than one of the objects you > > > create onto the stack isn't useful. > > > > That is exactly the problem. Inside one pattern I cannot add more than one > > object to the stack as popping only happens when the pattern ends. And not > > the rule... > > > > Yep. Umm..I meant Nope. An ObjectCreateRule pushes an object when begin is executed and pops the corresponding object when end is executed. A pattern is nothing but a way to select a set of Rule objects. Your issue is that you have multiple ObjectCreateRule instances associated with a single pattern. All their begin methods fire when the element is matched, and all their end methods fire when is encountered. In between, there are multiple objects on the stack. This behaviour is fundamental to Digester. Note that I have a long-standing dislike of the xmlrules module, and this is a clear example of why. If you were using the java API directly then the way Rule objects and patterns work would be much more obvious. I suggest you look at the example code in the src/examples directory of the source download to learn how digester's API works. This may then shed some light on why your xmlrules definitions (ie rule definitions specified in an xml file) work the way they do. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org