Re: [dom4j-user] IndexOutOfBoundsException on attribute List

2004-06-25 Thread Maarten Coene
Hi Robert, glad you found a solution :-) The reason your code failed is this: when you detach the attribute from the newElem, it is also removed from the attrs List. So the way you iterate through that list is not correct. regards, Maarten Robert Koberg wrote: So looking closer at the API, I see

Re: [dom4j-user] IndexOutOfBoundsException on attribute List

2004-06-24 Thread Robert Koberg
So looking closer at the API, I see Element.appendAttributes... duh... I have to stop thinking the way I did with JDOM... sorry for the bother, -Rob I wrote: I am trying to replace/exchange attributes from a new element to an existing element.

[dom4j-user] IndexOutOfBoundsException on attribute List

2004-06-24 Thread Robert Koberg
I am trying to replace/exchange attributes from a new element to an existing element. newElem looks like: (The namespace matches the namespace of the existing element. I have also tried without the namespace) The method below breaks with an IndexOutOfBoundsException exception (further below).