Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 41155 invoked from network); 17 Feb 2005 05:48:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Feb 2005 05:48:25 -0000 Received: (qmail 24060 invoked by uid 500); 17 Feb 2005 05:48:20 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 24041 invoked by uid 500); 17 Feb 2005 05:48:20 -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 24028 invoked by uid 99); 17 Feb 2005 05:48:20 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from mta201-rme.xtra.co.nz (HELO mta201-rme.xtra.co.nz) (210.86.15.144) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 16 Feb 2005 21:48:18 -0800 Received: from mta1-rme.xtra.co.nz ([210.86.15.240]) by mta201-rme.xtra.co.nz with ESMTP id <20050217054815.PHJF23759.mta201-rme.xtra.co.nz@mta1-rme.xtra.co.nz> for ; Thu, 17 Feb 2005 18:48:15 +1300 Received: from [10.1.1.9] ([222.153.104.64]) by mta1-rme.xtra.co.nz with ESMTP id <20050217054814.YVHW22382.mta1-rme.xtra.co.nz@[10.1.1.9]> for ; Thu, 17 Feb 2005 18:48:14 +1300 Subject: RE: [digester] include in xmlrules From: Simon Kitching Reply-To: skitching@apache.org To: Jakarta Commons Users List In-Reply-To: References: Content-Type: text/plain Date: Thu, 17 Feb 2005 18:58:03 +1300 Message-Id: <1108619883.4246.5.camel@blackbox> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 2005-02-16 at 11:54 -0800, Gogineni, Pratima wrote: > On examining the stack I think I found the problem: > > In my rule creator: digester.addRule("f", rule); should actually be > digester.addRule("/f", rule); > > i.e. I need to have the path separator as well. > > Which means the Example given in the JavaDoc also needs to be corrected Could you please confirm this? It sure looks to me like the javadoc correctly reflects what the code is doing. DigesterRuleParser has a nested class RulesPrefixAdapter, which is the object that the custom addRules method actually adds its rules to. This class overrides the Rules.add method to transparently prepend the current match prefix when rules are added. And this method does: public void add(String pattern, Rule rule) { StringBuffer buffer = new StringBuffer(); buffer.append(prefix); if (!pattern.startsWith("/")) { buffer.append('/'); } buffer.append(pattern); delegate.add(buffer.toString(), rule); } So in your example, it looks to me like the rule is added with a pattern of a/b/c/d/e/f regardless of whether you call digester.addRule("f", ...); or digester.addRule("/f", ...); Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org