Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 73807 invoked from network); 3 Feb 2005 04:23:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Feb 2005 04:23:58 -0000 Received: (qmail 89171 invoked by uid 500); 3 Feb 2005 04:23:46 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 89152 invoked by uid 500); 3 Feb 2005 04:23:45 -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 89133 invoked by uid 99); 3 Feb 2005 04:23:45 -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, 02 Feb 2005 20:23:44 -0800 Received: from mta2-rme.xtra.co.nz ([210.86.15.240]) by mta201-rme.xtra.co.nz with ESMTP id <20050203042340.PNNQ23759.mta201-rme.xtra.co.nz@mta2-rme.xtra.co.nz>; Thu, 3 Feb 2005 17:23:40 +1300 Received: from [10.1.1.9] ([222.152.206.176]) by mta2-rme.xtra.co.nz with ESMTP id <20050203042340.ZPMA8463.mta2-rme.xtra.co.nz@[10.1.1.9]>; Thu, 3 Feb 2005 17:23:40 +1300 Subject: Re: [Digester] Is capability to set object property based on attribute value comparison present? From: Simon Kitching Reply-To: skitching@apache.org To: Kartik Asatkar Cc: commons-user@jakarta.apache.org In-Reply-To: <2bd891e305020215506bb73262@mail.gmail.com> References: <2bd891e305020215506bb73262@mail.gmail.com> Content-Type: text/plain Date: Thu, 03 Feb 2005 17:33:26 +1300 Message-Id: <1107405206.5418.95.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-02 at 17:50 -0600, Kartik Asatkar wrote: > Hi, > > This is regarding Digester v1.6 > > Is it possible to set an object property with value taken from body or > a particular attribute based on comparison of another attribute value > (this needs to be specified in the xml rule file)? > > Something like - > - if attribute X value matches Y then set parameter N to body of element > - if attribute X value matches Y then set parameter N to value of > attribute Z No such functionality is built in to digester. However it wouldn't be too hard to write a custom Rule to do this. Writing custom Rule classes is really pretty easy.... > > I need to be able to do this in the xml rule file? Accessing custom rule classes from xmlrules is complicated. In addition to creating your Rule, you need to subclass the o.a.c.d.xmlrules.DigesterRuleParser class to add a factory that can instantiate and configure your rule. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org