[jdom-interest] Another Element.setName request
Ken Rune Helland
kenh at csc.no
Tue Mar 20 07:19:09 PST 2001
At 04:38 PM 3/19/2001 -0600, Uwe_Hale at i2.com wrote:
>I read through the list archives and the arguments for making the element
>name immutable. "An Element with a different name is a different
>Element..." or something like that.
>I've created a clone, gotten a list from the parent, found the index of the
>element, removed it from the list, and inserted the clone at the same
>index. Long way around simply renaming something but that works.
>The problem is that in other locations in the code, I still have variables
>pointing to the original element ( different views). Of course they do
>not get updated with the new name since they are completely different
>objects. So I now have to write code to replace the old element with the
>new clone in several places.
>Or just add a setName to the source code and rebuild. <g>
>Just another vote to the many others asking for a simple way to setName or
>rename the name attribute of the element.
>"A rose by any other name is still a rose."
As long as an element is only in ONE place in ONE document
(as is now enforced by having parent references) i cant see
anything wrong in allowing change of the name (and namespace)
of an element.
More information about the jdom-interest