Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 18827 invoked from network); 21 Apr 2006 17:00:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2006 17:00:58 -0000 Received: (qmail 5643 invoked by uid 500); 21 Apr 2006 17:00:43 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 5579 invoked by uid 500); 21 Apr 2006 17:00:42 -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 5568 invoked by uid 99); 21 Apr 2006 17:00:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Apr 2006 10:00:42 -0700 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=HTML_MESSAGE,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ruanonline@gmail.com designates 66.249.92.172 as permitted sender) Received: from [66.249.92.172] (HELO uproxy.gmail.com) (66.249.92.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Apr 2006 10:00:41 -0700 Received: by uproxy.gmail.com with SMTP id m3so390953ugc for ; Fri, 21 Apr 2006 10:00:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=lorquAmBl2UFirvxmywKPnk+6B3VudIUvvOqnljO+IVR4/q5FTtWbRhUlM3nNa3zhueI+v2W9PMx731wCcAAJ6Aandu9wB/6nCtHyYjjsRrWSW6sVr2YLgp+nBxPrj8aBOKgvR6bnowC6XfpkWfwMfo9O0gW8jIKJoq/L56PJIU= Received: by 10.78.52.17 with SMTP id z17mr99983huz; Fri, 21 Apr 2006 10:00:20 -0700 (PDT) Received: by 10.78.34.1 with HTTP; Fri, 21 Apr 2006 10:00:20 -0700 (PDT) Message-ID: <96d00e340604211000j4ec330fck474be772bb25efb7@mail.gmail.com> Date: Fri, 21 Apr 2006 19:00:20 +0200 From: "=?ISO-8859-1?Q?Carlos_Ruano_S=E1nchez?=" To: "Jakarta Commons Users List" Subject: Re: [Digester] Getting attribute from Rule begin method In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5800_26315575.1145638820340" References: <96d00e340604201552t7083ac59ib8ebb1ef8c3cd5f4@mail.gmail.com> <1145615655.4540.6.camel@localhost.localdomain> <96d00e340604210745w738ee517k1566ee1892a97fc5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_5800_26315575.1145638820340 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I discovered what was happening! I've mixed the XMLs files I was using to test my application and the one I was using hadn't any attributes in the element. That's the reason why getLength() returned 0. I notice that I was making a mistake when I saw that the attributes that th= e Attributes object had where attributes from other elements and not from the element I thought Digester was processing. Perhaps Digester use always the same Attributes object... I'm sorry for making you lose your time answering my mail :(. Thank you anyway ;) Carlos On 4/21/06, Rahul Akolkar wrote: > > On 4/21/06, Carlos Ruano S=E1nchez wrote: > > Thank you for your response! > > > > I'm not using any VariableSubstitutor so I think that's not the reason > of my > > problem. > > > > I've tried again my code and I've got the same result: when I debug my > > program, I can see all the attributes with their values inside the > > Attributes object but when I try to get them, I get only nulls or empty > > strings. > > > > How do you get the attribute names and values? Maybe I'm not using the > > methods properly. > > > > > > public CustomRule extends Rule { > > public final void begin(final String namespace, final String name, > final Attributes attributes) throws > Exception { > String foo =3D attributes.getValue("foo"); > // do something interesting with foo > } > > // and so on ... > } > > > Maybe try to write a simplest test case that doesn't work for you? > > -Rahul > > > > Thanks! > > > > Carlos > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > ------=_Part_5800_26315575.1145638820340--