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 the
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 <[EMAIL PROTECTED]> wrote:
>
> On 4/21/06, Carlos Ruano Sánchez <[EMAIL PROTECTED]> 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.
> >
> <snip/>
>
> <pseudo>
> public CustomRule extends Rule {
>
> public final void begin(final String namespace, final String name,
> final Attributes attributes) throws
> Exception {
> String foo = attributes.getValue("foo");
> // do something interesting with foo
> }
>
> // and so on ...
> }
> </pseudo>
>
> Maybe try to write a simplest test case that doesn't work for you?
>
> -Rahul
>
>
> > Thanks!
> >
> > Carlos
> >
> <snap/>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>