D
David Portabella
Using the Java package org.w3c.dom,
I have an Element object.
How can I change the tagName of a given Element?
There is the method Element.getTagName(),
but I did not find the method Element.setTagName() or equivalent.
One solution could be to create a new Element, with the new name, move
all the children and attributes from the old element to the new one,
and to replace the new element for the old one in the tree.
Is there a simpler and more natural solution?
some xml util package (that works with org.w3c.dom)?
I have an Element object.
How can I change the tagName of a given Element?
There is the method Element.getTagName(),
but I did not find the method Element.setTagName() or equivalent.
One solution could be to create a new Element, with the new name, move
all the children and attributes from the old element to the new one,
and to replace the new element for the old one in the tree.
Is there a simpler and more natural solution?
some xml util package (that works with org.w3c.dom)?