From commons-user-return-12348-apmail-jakarta-commons-user-archive=jakarta.apache.org@jakarta.apache.org Wed Jun 08 16:54:24 2005 Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 16518 invoked from network); 8 Jun 2005 16:54:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Jun 2005 16:54:23 -0000 Received: (qmail 48987 invoked by uid 500); 8 Jun 2005 16:54:17 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 48972 invoked by uid 500); 8 Jun 2005 16:54:16 -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 48959 invoked by uid 99); 8 Jun 2005 16:54:16 -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 sprite.apisnetworks.com (HELO sprite.apisnetworks.com) (66.98.228.68) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 08 Jun 2005 09:54:14 -0700 Received: from [127.0.0.1] (69-172-47-145.chvlva.adelphia.net [69.172.47.145]) (authenticated) by sprite.apisnetworks.com (8.11.6/8.11.6) with ESMTP id j58Grbk04889 for ; Wed, 8 Jun 2005 12:53:37 -0400 Message-ID: <42A74CBC.1080405@tarksoft.com> Date: Wed, 08 Jun 2005 12:53:32 -0700 From: Dan Tarkenton User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: commons-user@jakarta.apache.org Subject: Need to create custom Rule? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello all. I have a brief question that I believe revolves around the creation of a custom Rule implementation. I have an xml pattern that I need to digest/parse, but I'm unsure of how to go about this programmatically. The pattern i'm interested in is: I essentially want to find the child element whose name attribute is theParamDesired -- every time I find this attribute I want to call a setValue(theValueISeek) method on some object. I want to ignore all other child elements which have different name/value attributes. I'm not all that comfortable with manipulating the stack with a custom Rule implementation. I chose to use digester because it's usually a very fast and simple way to get my XML parsing needs satisfied (well, at least for SAX parsing). Plus, I'm working with a high volume of messages to parse, so SAX is appropriate here. So do I need to create a custom rule here? I don't think I missed a convenience method that already exists that would cover this issue, but I could be wrong. If I do need to create a custom Rule, I suppose I could take a look at the source for some of the Rule classes that exist now. I figure this is a common pattern to encounter and that I'm just missing the obvious here. Any direction would be greatly appreciated. Thanks in advance. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org